There are 92 references to coffee in The Girl With the Dragon Tattoo, whose protagonist, Lisbeth Salander, wreaks bloody revenge in Stieg Larsson’s Swedish crime thrillers. Indeed, people in the Scandinavian country drink the equivalent of 18 pounds of coffee every year, making Sweden the world’s sixth most caffeinated nation.

But the country’s coffee habit hasn’t always been a given. Starting in the 18th century, Sweden’s leaders tried to ban the beloved caffeine source. And one Swedish king hated coffee so much, he pitted two murderers against one another to prove how deadly the drink was.

Coffee made its way to Sweden in the 17th century as world trade opened up, and Swedes immediately took to the drink. But their monarchs did not, believing that coffee made people behave badly. Starting in 1756, during the reign of Adolf Frederick, the country began to impose a heavy tax on coffee imports and consumption as a result of the “misuse of tea and coffee drinking.” Those who insisted on drinking coffee without paying the tax were punished by having their cups and saucers confiscated.

Later that year, coffee was banned altogether. Royal officials tried to paint coffee as an un-Swedish move and encouraged Swedes to enjoy other drinks instead. Swedes, especially upper-class ones who could afford the precious beans, shrugged and kept on drinking coffee despite the ban. A flourishing bootlegging trade made the beverage widely available.

Portrait of Adolf Frederick of Sweden. (Credit: DeAgostini/Getty Images)

Then Gustav III came to power. The son of the king who originally banned coffee, he was disgusted by coffee and convinced it had bad effects on one’s health. He was so against the bitter brew that he decided to use science—or what passed for it—to prove to his subjects that they should give up coffee once and for all.

In a move that would make modern scientists’ jaws drop, Gustav enlisted prisoners for a scientific experiment. He found two convicted murderers on whom to conduct his experiment—an early example of a controlled study. The men had been sentenced to death, so the king offered them life in prison instead if they’d participate.

Some versions of the story say that the men were identical twins; in either case, they were given a not-so-terrible task in prison: drinking coffee and tea. One brother was required to drink three pots of coffee every day; the other was assigned an equal amount of tea.

The men set about their tasks, and Gustav awaited the results of the scientific control experiment. But though he assumed the coffee drinker would soon succumb to the deleterious effects of the drink he hated so much, Gustav was wrong. The man lived…and, ironically, outlived Gustav himself.

(Credit: Björn Wylezich/Alamy Stock Photo)

In 1792, Gustav received a mysterious, anonymous letter in his quarters while he prepared to attend a lavish, masked ball at Stockholm’s Royal Opera House. The note suggested that he had political enemies and that his life would soon end. But Gustav waved off the threat and attended the ball anyway.

Later that night, masked men surrounded the king and shot him in the back. But though Gustav initially survived, the wound became infected and he died a few weeks later.

The people who took Gustav’s life were noblemen who opposed the king’s ongoing campaign against the nobility. Gustav thought that the nobility were abusing their political privileges—privileges that presumably included evading the country’s strict coffee ban.

Not only did the coffee- and tea-drinking prisoners outlive their king, but they outlived the doctors Gustav appointed to oversee them. The tea-drinking twin lived until he was 83 years old; it’s not clear how long his coffee-drinking brother survived thereafter.

Gustav wasn’t alone in his distaste for coffee: He had good company in Prussian King Frederick the Great. Not only did he ban coffee, but he took things one step further, banning coffee roasting and sending sniffers into the street to track scofflaws by the scent of their coffee. “It is disgusting to notice the increase in the quantity of coffee used by my subjects,” Frederick wrote in an anti-coffee manifesto in 1777. “Everybody is using coffee….My people must drink beer.”

Yet, despite the best efforts of royals in two nations, coffee culture became ingrained across Europe. In Sweden, the concept of fika—“having coffee”—is a beloved national tradition that’s practiced at least two times a day in most offices and households, and the social practice is so ubiquitous and cozy that it’s thought to contribute to Sweden’s relatively peaceful culture.