ASHTON, Idaho -

There was a time when Ashton's drinking water was some of the dirtiest in the state by exceeding the state's limit for potentially dangerous chemicals known as nitrates.

But in less than two years city officials have managed to turn things around and now they say the water is safe to drink.

In December 2012 the city constructed a $3.1 million water treatment facility.

"The pump brings the water in. It goes through the exchangers and it comes back after it's been treated to remove the nitrates,” said city clerk Cathy Stegelmeier.

Before the facility was constructed nitrate levels in Ashton exceeded the state's limit of 10 milligrams per liter.

"I think the highest it ever got was 15,” said Mayor Teddy Stronks.

Facing fines and worried about health risks, such as the potential for birth defects in unborn babies, city leaders say they had no choice but to build the facility.

"We saw improvements immediately because we could remove the nitrates,” said Stegelmeier.

Not only are nitrates being filtered out, but experts are helping keep them out of the water in the first place.

"We found out that the pH in the soil was extremely low,” said Ken Beckmann, a district conservationist with the Natural Resources Conservation Service. “When that's the case, the crop cannot uptake the fertilizer like it should."

Instead, nitrate-rich fertilizers often seep into the groundwater.

"We help the farmers correct the pH problem in the fields,” said Beckmann.

The city paid for the treatment facility with a loan that it will pay off over a period of 30 years.

As a result, Ashton residents must pay a base water rate of $32.