The Environmental Protection Agency overstepped its authority in trying to regulate water flow to protect the habitat of worms, snails and insects in Accotink Creek, a federal judge ruled Thursday.

Judge Liam O'Grady said the federal agency was in violation of the Clean Water Act and therefore couldn't order Fairfax County officials to spend money to cut the flow of the creek and other waterways in the region

"EPA's thinking here was that if Congress didn't explicitly prohibit the agency from doing something, that meant it could, in fact, do it," said Virginia Attorney General Ken Cuccinelli. "This incredibly flawed thinking would have allowed the agency to dramatically expand its power at its own unlimited discretion. Today, the court said otherwise."

The decision comes nearly six months after Fairfax County officials, along with the Virginia Department of Transportation, first filed the lawsuit against the EPA, and the judge's ruling save Virginia taxpayers more than $300 million in unnecessary costs, Cuccinelli said.