The city health department said on Friday the source of the deadly Legionnaires’ disease outbreak on the Upper East Side has been eliminated and those who live in or visit the area are no longer at heightened risk of catching the severe form of pneumonia.

“As a result of our strict enforcement and our swift action we can confirm the source of this Legionnaires’ disease community cluster has been eliminated,” Dr. Alister Martin, the city health commissioner, said in a morning press call.

The declaration came a day after the seventh death from the outbreak was announced, equaling the death toll from a Legionnaires’ outbreak last summer in Harlem. The cluster on the Upper East Side was first identified on July 2 and since then, 92 people have been diagnosed with Legionnaires, more than 70 were hospitalized, and five remain in the hospital, according to the city health department.

But Martin said it’s been at least two weeks since someone in the area has developed new symptoms of the disease, suggesting the threat has ended. It can take up to that long for symptoms to develop after exposure, he added.

City officials have said the outbreak was caused by a water cooling tower contaminated with Legionella bacteria, which causes the disease, located in one of the affected ZIP codes, which include 10128, 10028 and 10075.

Under city law, building owners are responsible for preventing the growth of Legionella in the water that sits in cooling towers. If mist contaminated with the bacteria gets sprayed into the atmosphere, it can sicken passersby.

The city health department has identified dozens of buildings that had Legionella growing in their cooling towers during the course of its investigation into the outbreak, including towers operated by the Met and the Guggenheim. All have since been remediated, but the city is still working to identify the tower that actually caused the outbreak, Martin said.

He said that in addition to testing all cooling towers in the affected area for Legionella, the city is also in the process of conducting more in-depth inspections to ensure buildings are following proper cooling-tower maintenance protocols.

About half of the 160 buildings with cooling towers in the affected area have been inspected so far, and those inspections have resulted in the city issuing 110 violations, Martin said. Two building owners have been identified as “bad actors,” including one who failed to register their cooling tower altogether, Martin said. He said those two building owners have been fined roughly $10,000 apiece.