COPENHAGEN—When Danish journalist Kjeld Hansen picked up a medical journal several years ago and read that 50 people from a kindergarten in the region had contracted an antibiotic-resistant staph infection, or MRSA, he couldn’t have imagined where that story would lead him. But four years later, he and his reporting partner, Nils Mulvad, have not only revealed that Denmark’s most important agricultural industry is riddled with a strain of MRSA that poses a serious threat to human health. They have also stood trial for publishing their findings, becoming poster boys for freedom of the press in a case that pits that right against the individual’s right to privacy.

Most MRSAs (the initials stand for methicillin-resistant staphylococcus aureas), which kill 18,000 people annually in the US, occur in hospitals or nursing homes—places where staph bacteria have the opportunity to develop resistance to the antibiotics widely administered there, and where they can result in life-threatening infections. But there’s another place where antibiotics are used freely, and that’s on livestock. Pigs in particular are susceptible to a strain called CC398, which, in turn, can be communicated to the people around them. Numerous studies in Europe and the US have found a significant relationship between the proximity to swine and MRSA rates in humans.

Hansen and Milvud didn’t know that when they started their research. Investigative reporters who have long worked on issues surrounding agricultural subsidies within the European Union, they were familiar with Denmark’s important pig farming industry, which represents a full 5 percent of the country’s total exports. But they had no idea that so many of those pigs were becoming infected with MRSA, nor that they were so effectively transmitting the bacteria to humans.

“At first, we were just trying to find out the magnitude, so we contacted the authorities,” says Hansen. “We tried five different offices and got ‘nos’ in all of them. And then finally one person, a doctor, gave us the names of 12 farms.” The leak set everything in motion.

In October 2010, the two published a story naming those farms on an investigative website called Aabenhedstinget. The piece also included the names of two individuals, owners of one of the farms, who were infected. But two days later, government officials informed them that publishing the two names violated Denmark’s data protection act, which prohibits the publication, without official permission, of what it deems “sensitive information,” including personal health-related matters. They altered the identifying information, referring to the the two only as ‘employees.’

It wasn’t enough. “The health authorities went after us,” says Mulvad. “For a long time, they tried to identify our sources, and when they gave up on that, they tried to hit us personally.” Legally, any suit for violation of privacy had to come from a directly affected party. “So they started writing letters to people at the farms we had named, telling them it was their right to go to the police,” he adds. One person—the owner named in the original piece—did just that, and last month, Hansen and Mulvad found themselves in a courtroom in Aarhus.

The Danish Health and Medicines Authority, or SST in its Danish initials, admits that they contacted the farmers, but says it did so in the interest of protecting individual privacy—and their own internal security. “The article disclosed very private information on identifiable individual’s health problems, their workplace and other information, including their MRSA CC398 status,” says SST Medical Officer Henrik Hansen. “We immediately realized that the published data originated from our own files, and therefore also that we had a severe data security problem. At that stage, we did not know how the two journalists had got access to the data. It was clear, though, that it only could take place by illegal methods.”

At the trial, things got even weirder. One of the witnesses for the defense, Hans Jørn Kolmos, a professor of microbiology, testified that one of his own patients, and two others that he knew of, had died of MRSA—and even more worryingly, that none of them had had contact with livestock. (A fourth victim has since been identified.)

That testimony, coupled with the information that Hansen and Mulvad have continued to unearth about the extent of infection rates, has only reaffirmed the reporters’ sense of purpose. “Until that point, all authorities had said there was no risk. But the ministry of health was concealing those deaths,” says Hansen. “Now, due to lack of action, this bacteria has escaped from hog farms—it’s out in the community.”

Lisa Abend covers European politics and culture from Copenhagen for Time magazine