The discovery was made in a packet of sprouts in the garbage can of two sick people living in North Rhine-Westphalia, the state's Consumer Affairs Ministry announced.
This is "the first time an unbroken chain of evidence" has been found linking the enterohaemorrhagic E. coli (EHEC) bacteria to a northern German sprouts farm, the ministry said.
The small organic farm, in the village of Bienenbüttel in Lower Saxony, has been ordered closed and all its products recalled.
The tests carried out by health institutes confirmed the presence of the virulent bacteria strain EHEC-0104 responsible for the current outbreak, the ministry added.
Two of three members of the family, living in Rhein-Sieg district, fell sick in mid-May.
North Rhine-Westphalia Consumer Affairs Minister Johannes Remmel welcomed the discovery, but said there remained "a small element of uncertainty" as the bacteria was found in an open packet of sprouts rather than an unopened one which would then have been uncontaminated by the garbage can.
Earlier on Friday, health officials said they were convinced that vegetable sprouts were to blame for the contamination, adding that the farm in Lower Saxony, which first came under suspicion at the weekend, was most likely the source.
"There's no other serious lead besides the sprouts," said Reinhard Burger, head of Germany's public health authority the Robert Koch Institute, at a press conference.
"People who ate sprouts were found to be nine times more likely to have bloody diarrhoea or other signs of EHEC infection than those who did not," he said.
The government Friday also lifted its earlier warning against eating raw tomatoes, lettuce and cucumbers which had dealt a stinging blow to farmers at the peak of the fresh produce season in Europe.
Vegetable producers across the continent have for weeks complained about the warnings, which they say are costing them hundreds of millions of euros in lost sales. But German officials struggled for weeks to find cause of the EHEC infections, which can cause kidney failure.
"The number of new infections is declining," Burger said, referring to a drop in cases earlier this week.
But he warned that the "outbreak is not yet over", saying that some people were still falling ill after being contaminated several days ago.
After criticism of the government's handling of the crisis, the Agriculture and Health ministries said Berlin would review the response on the federal and state level.
German authorities had initially fingered cucumbers imported from Spain as responsible for the outbreak. But they later retracted the statement based on subsequent tests, infuriating Madrid and sparking threats of lawsuits.
But German Health Minister Daniel Bahr insisted that Germany had been right to warn against eating certain vegetables as long as the source of the contamination had not been pinpointed.
"Public health is the priority," he said.