WASHINGTON — A federal appeals court ordered the Environmental Protection Agency on Thursday to bar within 60 days a widely used pesticide associated with developmental disabilities and other health problems in children, dealing the industry a major blow after it had successfully lobbied the Trump administration to reject a ban.

The order by the United States Court of Appeals for the Ninth Circuit came after a decade-long effort by environmental and public health groups to get the pesticide, chlorpyrifos, removed from the market. The product is used in more than 50 fruit, nut, cereal and vegetable crops including apples, almonds, oranges and broccoli, with more than 640,000 acres treated in California alone in 2016, the most recent year data is available.

In March 2017, just a month after he was confirmed as the agency’s administrator, Scott Pruitt rejected a petition by the health and environmental groups to ban the pesticide. He did so even though the agency’s own staff scientists had recommended that chlorpyrifos be removed from the market, based on health studies that had suggested it was harming children, particularly among farmworker families.

A three-judge panel, on a 2-to-1 vote, gave the agency two months to finalize the ban on the product, whose leading manufacturer is DowDuPont. The company, along with others in the pesticide and agriculture industry, had intensely lobbied the E.P.A. and Mr. Pruitt, who resigned under a cloud of ethics scandals last month.