In the 15th century, a group of people in Yemen first cultivated coffee beans and brewed a drink from them. That drink — coffee, of course — was originally used in religious ceremonies, but within one hundred or so years, the drink’s popularity — secular and religious alike — had spread throughout the Middle East and well into Europe. Fast forward to modern times, and coffee is a popular drink throughout the world. But that almost didn’t happen, and may not have but for the Pope.

Coffee’s Muslim origins did not sit well with many Europeans, especially Catholic priests, according to the book “Coffee: The Revolutionary Drink for Pleasure and Health.” The book states that some priests went quite far with their objection and “denounced it as an invention of Satan.” The logic was convoluted. As the book explains (to use the term loosely), these priests believed that Muslims worshiped the devil and the devil forbade his followers from drinking wine, as that drink was reserved for those who followed Jesus. So the devil provided coffee, instead. Again, that’s a stretch, but it’s apparently the thought process that promulgated through the ranks of the Church.

Ultimately, the question made its way up to the Pope. According to Yale Global, a publication of Yale University’s Center for the Study of Globalization, Pope Clement VIII, in 1600, not only okayed coffee’s use, but also endorsed it. Yale Global asserts that Clement VIII’s decision was based in pragmatism — he appreciated the notion that coffee could “help sober a population whose fluid intake was largely alcoholic beverages,” and mental_floss notes that the Pope considered (jokingly) having the drink baptized. But legend has it that Clement VIII’s interest in the bean was also a personal one. As NPR retells, rumor has it that Clement VIII sampled the drink himself, and told his advisers that “this Satan’s drink is so delicious that it would be a pity to let the infidels have exclusive use of it.”

Either way, the Church did not end up banning coffee — something for which many today are certainly thankful.

Bonus Fact : Which countries prefer coffee to tea, and vice versa? This map will help. Surprisingly, the Middle East (for where there’s data, at least), has forsaken coffee for tea, in some cases by enormous margins.

From the Archives: No Starbucks: Why Finland and Norway didn’t have any Starbucks (until recently).

Related: Three different books about the history of coffee (or history through the lens of coffee).