Lead levels in tap water in Flint, Michigan, are no longer dangerous if the water is filtered, officials said Thursday.

The announcement by the Environmental Protection Agency (EPA) came after months of warnings that pregnant women and children under the age of 6 should stick to bottled water. Dangerously high levels of lead have been present in the city's water since 2014, and after community outrage over inaction, Michigan Gov. Rick Snyder declared a state of emergency in January.

With official recognition of the crisis, residents began receiving bottled water and free filters. But lead levels in some areas were so high, it was unclear if the filters had the power to render the water safe to drink.

Lead is particularly harmful to children and can cause a variety of health, behavioral, and developmental problems. Researchers last year showed an increase in the number of children with elevated lead levels in their blood after the city switched its water supply to the Flint River as a cost-saving measure.

More than 50,000 filters have been provided to residents since January, according to the EPA. Over the last two months, officials have been testing lead levels in water from across the city to determine how well the filters are working.

Carolyn Kaster / AP

In May, President Obama visited the city and drank its water, telling residents, "I've got your back." Still, officials said bottled water should be used in formula for infants under 1, and pregnant women and children under 6 were also warned that bottled water was a safer choice.

On Thursday, officials announced that nearly all the filtered water tested to have a lead level of less than one part per billion. The EPA allows up to 15 parts per billion of lead in drinking water.

“With the results of this testing, residents can be confident that they can use filtered water and protect their developing fetus or young child from lead,” Dr. Nicole Lurie of the Department of Health and Human Services said in a statement. “It’s crucial that people in Flint install filters on faucets they use for drinking water, cooking, or brushing their teeth, and replace the filter cartridges regularly.”

The findings by the EPA match those of independent tests by Virginia Tech University and NSF International, officials added.

“These findings reaffirm the effectiveness of filters at removing or reducing lead," the EPA's Tom Burke said in a statement. "This is an important step forward for providing a stable water system for the city of Flint."