BERLIN  German officials halted sales from 4,700 small farms on Friday and pulled millions of eggs from the shelves after dioxin was discovered in feed for chickens and pigs and the authorities announced that the contamination might have started months ago. The news set off a scramble in countries that import food from Germany, with two banning the sale of some animal products.

The contamination occurred when a manufacturer shipped tainted fat for use in animals’ food pellets.

German officials said the levels of the toxin dioxin in meat and eggs was likely to be too low to affect human health. But the episode, which was expected to cost German farmers tens of millions of dollars, was already raising questions about the rigor of food testing in Germany and the strength of food safety regulations in the European Union.

The scandal also threatened to widen with an announcement on Friday from the German agriculture ministry that it had evidence that the manufacturer might have begun shipping the dioxin-laced fat in March  months before it admitted to what it called a one-time problem. The ministry said the company might have been shipping the fat despite test results in March that might have alerted it to the problem.