A ban on the sale of a controversial but widely used pesticide that has been linked to brain damage and other health problems in children took effect across California on Thursday, in a rebuke to the Trump administration, which has worked to keep it legal.

The chemical, chlorpyrifos, is an insecticide used by farmers to control worms, insects and other pests on a variety of crops, including grapes, walnuts, lemons, oranges, alfalfa and cotton.

But an increasing body of studies linked it with reduced IQ, attention disorders and low birth weight in children.

Meanwhile, as California’s ban took effect Thursday, Corteva Inc., a company formed last year by the merger of Dow Chemical and Dupont, announced it would stop making chlorpyrifos by the end of the year, citing declining sales.

“It’s about time that Corteva stops selling a pesticide that damages children’s brains and poisons farm workers,” said said Marisa Ordonia, a senior attorney for the environmental group Earthjustice. Yet the (federal) government must take a stand and ban this chemical.”

The U.S. Environmental Protection Agency banned chlorpyrifos for residential sale in 2001. The chemical remained legal for farmers, however.

Following health studies that linked the chemical to brain damage and neurological problems in children, particularly the children of farm workers, the Obama administration began the process of banning it nationwide.

In 2017, the Trump administration, after heavy lobbying by the chemical industry, reversed course and said its sale would continue to be allowed. The U.S. EPA says it plans to complete a review of the chemical by Oct. 1, 2022.

“By reversing the previous administration’s steps to ban one of the most widely used pesticides in the world, we are returning to using sound science in decision-making – rather than predetermined results,” said Scott Pruitt, Trump’s former EPA administrator, in 2017.

The American Academy of Pediatrics issued a statement after that decision saying it was “deeply alarmed” by the move.

“There is a wealth of science demonstrating the detrimental effects of chlorpyrifos exposure to developing fetuses, infants, children and pregnant women,” the organization said. “The risk to infant and children’s health and development is unambiguous.”

Pruitt resigned in 2018 over controversies involving his first-class government travel and questionable ties with industry lobbyists. He became a coal industry lobbyist last year.

After a review of health studies by the California Environmental Protection Agency in 2018 concluded the chemical was linked to brain damage and neurological damage at levels in children at lower than previously thought, California moved toward a statewide ban.

That year the state Department of Pesticide Regulation also designated the chemical as a “toxic air contaminant” and recommended that county agricultural commissioners ban aerial spraying and require quarter-mile buffer zones to fields where it was applied.

Finally, last May, Gov. Gavin Newsom’s administration announced it would ban the chemical statewide. In October, Newsom reached an agreement with chemical companies to phase out the sale of chlorpyrifos by Feb. 6, 2020. Farmers with existing stocks of the chemical will have until the end of the year to use up any remaining quantities.

“If only President Trump’s EPA had listened to its own scientists and not blocked a federal ban of chlorpyrifos, millions of other kids would enjoy the same protections,” said Ken Cook, president of the Environmental Working Group, on Thursday.

Newsom also added $5.7 million to the state budget last year to fund research and grants into alternative, less toxic alternatives. But farmers say that work has yet to show results.

“Insects and crop diseases pose a real threat to the food farmers grow, and losing an important tool such as chlorpyrifos will leave food crops more vulnerable,” said Jamie Johansson, president of the California Farm Bureau Federation. “When it cancelled chlorpyrifos last year, the state said it would fund research and lead discussions into alternative insecticides. So far, those discussions have been disappointing. We need state agencies to be open-minded and realistic in evaluating ways to protect crops from pests and plant diseases.”

California’s ban is particularly noteworthy because California is the nation’s largest agricultural state, with $50 billion in agricultural sales from more than 400 crops and farm products. Hawaii also has banned chlorpyrifos and New York is working to phase it out by next year.