A federal judge Monday ordered the Environmental Protection Agency to craft new pollution standards for the Anacostia River that would allow officials to make it safe for swimmers and boaters.

In a 67-page ruling in a lawsuit brought by two non-profit environmental groups, Chief U.S. District Judge Royce C. Lamberth wrote that the EPA acted “arbitrarily and capriciously” in coming up with pollution levels that would allow for safe “recreational and aesthetic uses” of the river.

Lamberth gave the EPA a year to come up with a better plan. “The Anacostia, in a word, is dirty,” Lamberth wrote before sharply criticizing officials at the EPA and in Maryland and District governments for failing to fix the river over the years.

Lamberth wrote that the EPA and local governments had come up with pollution standards that would make the river safe for marine and plant life. However, Lamberth found, federal and local officials were not able to prove that those standards would also make the river safe enough for people to enjoy.