WASHINGTON — A federal appeals court ruled Thursday that the Trump administration endangered public health by keeping the widely used pesticide chlorpyrifos on the market despite extensive scientific evidence that even tiny levels of exposure can harm babies' brains.

The 9th U.S. Circuit Court of Appeals in San Francisco ordered the Environmental Protection Agency to remove chlorpyrifos from sale in the United States within 60 days.

A coalition of farmworkers and environmental groups sued last year after then-EPA chief Scott Pruitt reversed an Obama-era effort to ban chlorpyrifos, which is widely sprayed on citrus fruits, apples and other crops. The attorneys general for several states joined the case against EPA, including California, New York and Massachusetts.

In a split decision, the court said Thursday that Pruitt, a Republican forced to resign earlier this summer amid ethics scandals, violated federal law by ignoring the conclusions of agency scientists that chlorpyrifos is harmful.

"The panel held that there was no justification for the EPA's decision in its 2017 order to maintain a tolerance for chlorpyrifos in the face of scientific evidence that its residue on food causes neurodevelopmental damage to children," Appeals Court Judge Jed S. Rakoff wrote in the majority's opinion.

EPA spokesman Michael Abboud said the agency was reviewing the decision. It could appeal the ruling to the Supreme Court.

Environmental groups and public health advocates hailed the court's action as a major victory.

"Some things are too sacred to play politics with, and our kids top the list," said Erik Olson, senior director of health and food at the Natural Resources Defense Council. "The court has made it clear that children's health must come before powerful polluters. This is a victory for parents everywhere who want to feed their kids fruits and veggies without fear it's harming their brains or poisoning communities."

Chlorpyrifos was created by Dow Chemical Co. in the 1960s. It remains among the most widely used agricultural pesticides in the United States, with the chemical giant selling about 5 million pounds domestically each year through its subsidiary Dow AgroSciences.

Dow did not immediately respond to an email seeking comment. In past statements, the company has contended the chemical helps American farmers feed the world "with full respect for human health and the environment."

Chlorpyrifos belongs to a family of organophosphate pesticides that are chemically similar to a chemical warfare agent developed by Nazi Germany before World War II.

As a result of its wide use as a pesticide over the past four decades, traces of chlorpyrifos are commonly found in sources of drinking water. A 2012 study at the University of California at Berkeley found that 87 percent of umbilical-cord blood samples tested from newborn babies contained detectable levels of the pesticide.

Under pressure from federal regulators, Dow voluntarily withdrew chlorpyrifos for use as a home insecticide in 2000. EPA also placed "no-spray" buffer zones around sensitive sites, such as schools, in 2012.

In October 2015, the Obama administration proposed banning the pesticide's use on food. Pruitt reversed that effort in March 2017, adopting Dow's position that the science showing chlorpyrifos is harmful was inconclusive and flawed.