After a month of searching and testing thousands of vegetables, simple detective work trumped science in the hunt for the source of the world’s deadliest E. coli outbreak. The culprit: German-grown sprouts.

Health officials announced on Friday that sprouts from a farm in northern Germany caused the outbreak that has killed 31 people, sickened nearly 3,100 and prompted much of Europe to shun vegetables.

“It was like a crime thriller where you have to find the bad guy,” said Helmut Tschiersky-Schoeneburg, head of Germany’s consumer protection agency.

Health officials said they tracked the bacteria’s path from hospital patients struggling with diarrhea and kidney failure, to the restaurants where they had dined, to specific meals and ingredients they ate, and finally back to a single farm.

There are more questions to answer, including what contaminated the sprouts in the first place: Was it tainted seeds or water, or nearby animals? The answer is still elusive.

Still, it was little surprise that sprouts were the culprit. They have been blamed in least 30 food poisoning cases over the past 15 years in the U S and a large outbreak in Japan in 1996 that killed 11 people and sickened more than 9,000.

While sprouts are full of protein and vitamins, their growing conditions and the fact that they are mostly eaten raw make them ideal transmitters of disease. Cultivated in water, they require heat and humidity, precisely the same conditions E. coli needs to thrive. Sprouts have abundant surface area for bacteria to cling to and washing won’t help if the seeds themselves are contaminated.

“E coli can stick tightly to the surface of seeds used to grow sprouts and they can lay dormant on the seeds for months,” said Stephen Smith, a microbiologist at Trinity College in Dublin. Once water is added to make them grow, the bacteria can reproduce up to 100,000 times.

Interviews with thousands of patients, mostly women ages 20 to 50 with healthy lifestyles, led investigators to conclude initially that salads could be the problem.

More In: Medicine | Health | Sci-Tech