The Environmental Protection Agency will ban the use of a pesticide widely applied on food crops but linked to neurological damage in children, reversing one of the Trump administration’s most fraught public health decisions.

The final rule released Wednesday will put a stop to the spraying of chlorpyrifos on fruits and vegetables across the country, to protect the health of both farmworkers dispersing the pesticide and children eating produce treated with it.

The move to curtail use of the potent insect-killing chemical on food overturns a 2017 decision by then-EPA Administrator Scott Pruitt to keep the pesticide on the market despite a recommendation by the agency’s scientists to restrict it, given its potential risks.

“This comes after more than a decade of science in which it became pretty clear that there were potential neurodevelopmental effects on children that were being observed at lower levels than people had previously thought,” Michal Freedhoff, the EPA’s top official for chemical safety and pollution prevention, said in a phone interview.

For a half-century, chlorpyrifos has proved effective in keeping all sorts of pests off soybeans, almond trees, cauliflower and other crops. Farmers often deploy it when no other pesticide can do the job.

But for the past decade, environmental, labor and public-health groups have clamored for phasing out the pesticide, which can lead to headaches or blurred vision when inhaled or ingested. Some studies of families in apartment buildings found that exposure during pregnancy led to memory loss and other cognitive issues in children.

The EPA is using a 1996 food-quality law that strengthened protections for infants and children to issue its ban.

Claudia Angulo, a farmworker who came from Mexico to work the citrus and broccoli fields in California’s San Joaquin Valley, was pregnant when she was exposed to chlorpyrifos. She blames the pesticide for her son Isaac’s developmental delays, after the chemical showed up in tests on his hair.

“It’s affecting a lot of families. We’re all being affected, either with allergies or some with disabilities,” said Angulo, who is now part of a class-action lawsuit. “As a mother, I’m still struggling and won’t stop until this pesticide is not harming kids.”

But the industry has taken aim at a key study identifying chlorpyrifos’s risks, conducted by Columbia University. That research focused on illnesses within a specific group of people rather than a direct test on animals, the method EPA has historically used to determine a pesticide’s safety.

Sam Kieffer, vice president for public affairs at the American Farm Bureau Federation, told the EPA in March that the Columbia study is “not supported by verifiable science” since the agency is not able to look at its underlying data.

“AFBF asserts that chlorpyrifos is a valuable crop protection tool with no viable alternative,” he wrote in a comment on the proposed rule.

But Earthjustice managing attorney Patti Goldman, whose group sued the EPA after it permitted continued use of the pesticide, said the “only legally and scientifically defensible action” is to ban its use on food.

“It’s kind of an archaic type of pest management because it just goes after anything,” Goldman said. “It’s really old-school. But if something new pops up, then it’ll often be the thing that will be used.”

Several states including California, Hawaii, New York, Maryland, and Oregon — as well as Canada and the European Union — are already phasing out the insecticide on farms. In 2000, federal regulators struck a deal with chemical makers to limit the use of chlorpyrifos for killing termites and several pests in homes.

The EPA was prompted to act by a scathing federal court decision in April that blasted the Trump administration’s decision to keep the chemical on the market. The U.S. Court of Appeals for the 9th Circuit ruled the agency must ban the spraying of chlorpyrifos on food crops unless its staff could show it can be used safely.

“The court basically said, ‘Enough is enough,’ ” Freedhoff said. “ ‘You need to make this judgment once and for all.’ And so the Biden administration did review the science and did conclude that it is not possible to find that this substance is safe when used on food.”

The EPA’s decision this week marked the culmination of a decade-and-a-half fight, which began when environmental groups petitioned the agency in 2007 to revoke all uses of the pesticide on food. Eight years later, in 2015, the EPA under President Barack Obama responded by proposing to prohibit the pesticide, but the Trump administration changed course, pointing to concerns from Agriculture Department officials about the negative impact of the restrictions on farmers.

Corteva Agriscience, once the world’s largest manufacturer of chlorpyrifos, said last year that it would stop manufacturing the pesticide, though it stood by the chemical’s safety’s record.

Still, some chemical and agricultural businesses have fought to keep it on the market, given its effectiveness. Chris Novak, head of the agrochemical trade association CropLife America, said Biden officials were falling short of their own promises to follow the best science.

“President Biden campaigned with the slogan of ‘Science over Fiction,’ but the EPA’s decision to cancel all tolerances of chlorpyrifos does not live up to that standard or to the EPA’s commitment to scientific integrity,” Novak said in a written statement. “Decades of review by EPA career staff and independent scientific advisory panels have repeatedly supported safe uses for this product, yet this decision comes without a full scientific review or a thoughtful assessment of the beneficial uses of this product.”

For now, chlorpyrifos can still be used for growing cotton and treating golf courses. The EPA will make a decision on whether to continue to allow for those and other nonfood uses by the end of next year.