A federal court on Thursday ordered the FDA to follow through on a 35-year-old proposal that would have banned the use of certain antibiotics in animal feed because the agency was concerned that these drugs were overused in livestock and helped develop drug-resistant bacteria that can infect people.

The concern is that some antibiotics given to treat illnesses in people are widely used on animals to promote disease prevention and weight gain, as well as compensate for crowded conditions on ranches and farms. The prevalence of those antibiotics in livestock has been linked in several studies to the creation of drug-resistant “superbugs” that can spread to humans who work with or eat the animals.

In 1977, the Food and Drug Administration proposed banning the use of penicillin and two forms of tetracyline for growth promotion. But the proposal has been in limbo ever since. The agency never held hearings or took any further action, prompting the Natural Resources Defense Council and four other health and consumer advocacy groups to sue the government in May 2011.

A federal district court in Manhattan ruled in favor of the plaintiffs on Thursday, compelling the FDA to press forward with its initial plan to start proceedings that could lead to a withdrawal of the drugs. The decision handed a major victory to consumer advocates.

“The scientific evidence of the risks to human health from the widespread use of antibiotics in livestock has grown, and there is no evidence that the FDA has changed its position that such uses are not shown to be safe,” Judge Theodore H. Katz wrote.

The FDA must now grant the drugmakers an opportunity to appear at a hearing and prove that the antibiotics are safe.

“If, at the hearing, the drug sponsors fail to show that the use of the drugs is safe, the [FDA] Commissioner must issue a withdrawal order,” Katz wrote.

On Thursday, the agency declined to comment on the opinion except to say that it is studying it and considering the appropriate steps.

The agency has been pursuing alternative paths of regulation in recent years as pressure mounted to act. In 2010, it issued voluntary guidelines urging the judicious use of antibiotics, but it has yet to finalize that plan.

In December 2011, it quietly rescinded its initial 35-year-old plan to withdraw approval for penicillin and the two tetracycline drugs — chlortetracycline and oxytetracycline — on the grounds that the proposal was outdated.

But a month later, it proposed to restrict cephalosporin, a family of antibiotics commonly used to treat livestock. It said those antibiotics could not be used to prevent diseases in livestock starting April 5, although they could still be used to treat illnesses.

Consumer advocates supported the move. But the court’s decision affects a far greater share of antibiotic use in animals, said Avinash Kar, a lawyer at the Natural Resources Defense Council.

“This is a long overdue step toward preserving life-saving medicines for when we need them,” Kar said. “These antibiotics were meant to cure disease, not to fatten up pigs and chickens.”