After a month of testing thousands of vegetables, simple detective work has trumped science in the hunt for the source of the world’s deadliest E. coli outbreak.

The culprit: sprouts.

Health officials said sprouts from a farm in northern Germany caused the outbreak that killed 31 people, made nearly 3100 ill 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 diarrhoea and kidney failure, to the restaurants where they had dined, to specific meals and ingredients they ate, and finally back to a single farm.

More questions still need answers, including what contaminated the sprouts in the first place – 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 past food-poisoning cases, including in the US in 2005 and in Japan in 1996 that killed 11 people and made more than 9000 ill.

Sprouts are full of protein and vitamins but their growing conditions and the fact that they are mostly eaten raw make them ideal transmitters of disease.

They require about 37C heat and humidity – the same conditions E. coli needs to thrive – and washing won’t help if the seeds 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 Dublin’s Trinity College in Ireland.

Once water is added to make them grow, the bacteria can reproduce up to 100,000 times.

Interviews with thousands of patients – mostly women aged 20 to 50 with healthy lifestyles – led investigators to believe salads could be the problem.

Health officials immediately warned consumers to avoid cucumbers, tomatoes and lettuce, causing huge losses to European farmers as demand plummeted for their produce.

But the ubiquitous alfalfa, radish and other sprouts weren’t on anyone’s radar.

“You get this stuff in every cafeteria,” said Gert Hahne, spokesman for the Agriculture Ministry in Lower Saxony, the state where the contaminated sprouts were found.

“But after two weeks of diarrhoea, most people don’t remember if they had a few sprouts on top of a ham sandwich or mixed into a salad.”

Inspectors visited more than 400 farms in Lower Saxony alone and the state put 1000 people on the case, including health authorities, food inspectors and veterinarians.