NEW YORK - A federal appeals court in New York on Monday ordered the government to rewrite its rules regulating the discharge of ballast water by ships, in a victory for environmental groups that said the rules were too lenient and threatened the nation's waterways.

The 2nd U.S. Circuit Court of Appeals on Monday said the Environmental Protection Agency acted "arbitrarily and capriciously" when it decided in 2013 to follow an international standard governing the discharge of harmful organisms, though technology was available to adopt a higher standard.

Writing for a 3-0 appeals court panel, Circuit Judge Denny Chin also said the EPA, using its authority under the Clean Water Act, should have considered onshore facilities to treat ballast water rather than focus on pollution controls aboard ships, where a lack of space might limit their effectiveness.

Environmentalists have said that international standards for invaders may not be protective enough for U.S. waters.

"It's a huge win for the environment," said Allison LaPlante, a professor at Lewis & Clark Law School in Portland, Oregon representing four environmental groups that challenged the EPA.

The EPA did not immediately respond to requests for comment.

Ships take on and discharge ballast water, in quantities estimated at more than 21 billion gallons annually in the United States, to maintain stability and compensate for changes in weight, such as when they load and unload cargo or consume fuel.

But in taking on ballast water, ships can inadvertently pick up harmful organisms, as well as sediment and pollutants.

Ballast water is blamed for allowing many species to hitchhike from foreign ports to U.S. ports, including the Great Lakes, and including Duluth-Superior where invaders like zebra mussels, quagga mussels, ruffe, goby and spiny water fleas have taken hold after riding here in ballast tanks.

"Today's decision is a big victory for the Great Lakes and our nation's waters," said Rebecca Riley, senior attorney for the Natural Resources Defense Council. "Aquatic invasive species like zebra mussels and quagga mussels impose billions of dollars of costs on our economy every year, damaging infrastructure like public water supplies and energy generation systems, and devastating commercial and recreational fisheries. The court made it clear that EPA cannot give up in the fight against invasive species; more can and must be done to protect the Great Lakes and other critically important waters."

One such organism, zebra mussels, has caused particularly heavy damage in the Great Lakes region, the environmental groups have said.

The Natural Resources Defense Council, National Wildlife Federation, Center for Biological Diversity and Northwest Environmental Advocates had sued the EPA over its "Vessel General Permit" governing ships' release of ballast water.

"Invasive species ruin aquatic communities and their ecosystems," LaPlante said. "The EPA appeared to the take the path of least resistance by adopting an existing international standard that is inadequate to prevent their colonization."

In court papers, the EPA said it "proceeded methodically and reasonably" toward its conclusions, rather than focus on methods "destined not to play a role at the present time in redressing aquatic nuisance species in ballast water."

The case is Natural Resources Defense Council et al v. EPA et al, 2nd U.S. Circuit Court of Appeals, Nos. 13-1745, 13-2392, 13-2757.

Duluth News Tribune staff writer John Myers contributed to this story.