The Obama administration must warn drug makers that the government may soon ban agricultural uses of some popular antibiotics that many scientists say encourage the proliferation of dangerous infections and imperil public health, a federal magistrate judge ruled on Thursday.

The order, issued by Judge Theodore H. Katz of the Southern District of New York, effectively restarts a process that the Food and Drug Administration began 35 years ago, but never completed, intended to prevent penicillin and tetracycline, widely used antibiotics, from losing their effectiveness in humans because of their bulk use in animal feed to promote growth in chickens, pigs and cattle.

The order comes two months after the Obama administration announced restrictions on agricultural uses of cephalosporins, a critical class of antibiotics that includes drugs like Cefzil and Keflex, which are commonly used to treat pneumonia, strep throat and skin and urinary tract infections.

Siobhan DeLancey, an F.D.A. spokeswoman, would not say whether the government planned to appeal. “We are studying the opinion and considering appropriate next steps,” she said.