California, one of the nation’s largest agricultural states, announced plans Wednesday to ban the widely used pesticide chlorpyrifos linked to neurological problems in infants and children even as federal regulators have allowed the product to remain on the market.

State health officials said their decision came amid growing evidence that the pesticide, which is used on crops such as oranges, grapes and almonds, “causes serious health effects in children and other sensitive populations at lower levels of exposure than previously understood.” California Gov. Gavin Newsom (D) also has proposed $5.7 million to support the transition to “safer, more sustainable alternatives,” according to the California Environmental Protection Agency.

The ban, which is expected to take six months to two years to take full effect, comes as other states have started taking similar action. Last year, Hawaii became the first state to ban pesticides containing chlorpyrifos, though that will not take effect until 2022. New York lawmakers recently approved legislation to ban the pesticide by Dec. 1, 2021. Oregon, Connecticut and New Jersey also have bills to take chlorpyrifos off the market.

Environmental groups were quick to praise California’s decision, calling it a major win for public health that would help protect children, farmworkers and wildlife affected by the pesticide.

“Gov. Newsom has done what the Trump administration has refused to do: protect children, farmworkers and millions of others from being exposed to this neurotoxic pesticide,” Ken Cook, president of the Environmental Working Group, said in a statement. “With the governor’s action, California is once again showing leadership in protecting public health.”

DowDuPont, which manufactures chlorpyrifos and has insisted the chemical is safe for its intended uses, vowed Wednesday to fight California’s ban, saying it would “remove an important tool for farmers and undermines the highly effective system for regulating pesticides that has been in place at the federal level and in the state of California for decades.”

“This proposal disregards a robust database of more than 4,000 studies and reports examining the product in terms of health, safety and the environment,” company spokesman Gregg Schmidt said in an email. “We are evaluating all options to challenge this proposal.”

The U.S. Environmental Protection Agency estimates that between 5 million and 8 million pounds of chlorpyrifos is applied nationwide. Although farmers in California have scaled back their annual application from 2 million pounds in 2005 to 900,000 pounds in 2016, it still makes the state the nation’s top user.

Miriam Rotkin-Ellman, a senior scientist at the Natural Resources Defense Council, said in a phone interview that agricultural activists and environmentalists had spent more than a dozen years working to take chlorpyrifos off the market in California.

“It is groundbreaking,” she said of California’s move. “The states can chip away at this, and California’s a big part of the puzzle. Ultimately, though, we are going to need that federal ban to ensure protection for everybody.”

Chlorpyrifos has been used by farmers for decades to kill pests on crops. The EPA long ago banned its spraying indoors to combat household bugs, but only in recent years did the agency seek to end its use in agriculture, after mounting scientific evidence that prenatal exposure can pose risks to fetal brain and nervous-system development.

In 2015, under President Barack Obama, the EPA proposed revoking all uses of chlorpyrifos on food crops. That move came in response to a petition filed by the Natural Resources Defense Council and Pesticide Action Network North America. A federal judge had given the EPA until late March 2017 to decide whether to finalize its ban.

Facing a time crunch, then-EPA Administrator Scott Pruitt decided to scrap the proposed ban, saying he wanted to provide “regulatory certainty” to farms that relied on the pesticide. He also noted that the Agriculture Department had raised concerns about the methodology EPA scientists had used in determining that chlorpyrifos posed serious health risks.

Sheryl Kunickis, director of the Office of Pest Management Policy at the USDA, agreed with the decision at the time, saying it would allow “this important pest management tool [to] remain available to growers, helping to ensure an abundant and affordable food supply for this nation and the world.”

The chemical industry also has resisted a ban. Dow AgroSciences, which manufactures the pesticide, said in late 2016 that the Obama administration’s assessment of its safety “lacks scientific rigor.” The company added that it “remains confident that authorized uses of chlorpyrifos products, as directed, offer wide margins of protection for human health and safety.”

In August, a federal appeals court ordered the EPA to ban chlorpyrifos, saying in a 2-to-1 decision that the law requires the agency to act if it finds that exposure to a pesticide used on food can cause harm.

Judge Jed S. Rakoff, writing for the majority, said that over the past two decades, agency scientists had documented the possible adverse effects of chlorpyrifos on the mental and physical development of infants and children. He said the EPA “stalled” for years in banning the chemical and accused the agency of “utter failure” in responding to objections over Pruitt’s decisions to allow continued use of the pesticide.

“The time has come to put a stop to this patent evasion,” Rakoff wrote at the time.

The Department of Justice later asked the full U.S. Court of Appeals for the 9th Circuit to reconsider the opinion. A panel of 11 judges reheard oral arguments earlier this year. Last month, the court gave the EPA three months to justify the agricultural use of chlorpyrifos.

EPA spokesman Michael Abboud said in a phone interview that the agency “is currently reevaluating chlorpyrifos” as part of a regular pesticide review process mandated by Congress.