Back in 2005, 215 people were unexpectedly infected with the bacterium Streptococcus suis in Sichuan, China, which usually infects pigs and piglets. Within weeks, 39 infected people had died making it one of the worst S. suis outbreaks ever seen.

Now, researchers say they've pinned down the source of the outbreak for the first time, hopefully allowing governments to avoid this kind of crisis in the future.

S. suis is a bacterium that normally infects pigs, but it doesn't always stay put - by touching pig carcasses or handling sick piglets, humans can also be infected. 

In the 2005 case, people in 12 cities in China were affected, which made it the world's largest and geographically widespread outbreak of S. suis to date.

In pigs, the bacterium usually doesn't cause disease, but it's quite dangerous in humans - infection can cause sepsis, meningitis, deafness, and in 39 cases during the 2005 outbreak, even death.

But until this event, scientists had never seen the bacterium spread between humans before, so they didn't know how so many people could potentially get sick, especially over such a wide area.

The 2005 strain also seemed particularly deadly, with 30 percent of those infected being killed by the bacterium.

"The source of the deadly strain that caused the outbreak was unknown until now," says one of the team, Ruiting Lan, from the University of New South Wales (UNSW), Australia.

"Our research shows it developed in piglets raised by commercial breeding companies, which were then distributed to hundreds of individual backyard farmers across the province who slaughtered the grown pigs in their backyards and became infected."

Although a massive 215 people were infected, all infections occurred in backyard farmers who were directly exposed to the infection when slaughtering the pigs – so there's no indication that anyone should stop consuming pork just yet.

But this new evidence helps explain how so many people were infected in different place across China, at approximately the same time.

To find out what happened, the researchers analysed the genomes of 95 bacterial isolates from both patients and diseased pigs to investigate how this particularly dangerous strain evolved. 

They found that the deadly strain had evolved by the end of 2004, suggesting that the piglets were infected in a breeding facility in Sichuan, before being sold to farmers to fatten up.

The researchers also found that the people affected in the outbreak were living along major roads and highways where the piglets would have been transported and sold.

"The outbreak was an unforeseen consequence of China's economic development," says Lan.

"To increase pork production, companies used imported pig breeds rather than local ones and then supplied the infected piglets widely to farmers who raised them under poor hygienic conditions in their backyards."

"This combination of practices created a major threat to public health, significantly increasing the risk of a very large disease outbreak," he added.

But the researchers say that this kind of outbreak can be limited in future, now that we know the risk factors.

"A pathogen-free supply of piglets and improved hygiene for backyard farmers could help prevent such outbreaks," the researchers write in a paper on the research in Emerging Infectious Diseases.

"Alternatively, disease monitoring at the [piglet breeding companies] level would be a very effective outbreak-prevention strategy."

The research has been published in Emerging Infectious Diseases.

UNSW Science is a sponsor of ScienceAlert. Find out more about their world-leading research.