When British pharmacologist Stewart Adams and his colleague John Nicholson began tinkering with various drug compounds in the 1950s, they were hoping to come up with a cure for rheumatoid arthritis—something with the anti-inflammatory effects of aspirin, but without the risk of allergic reaction or internal bleeding.

Though they never exactly cured rheumatoid arthritis, they did succeed in developing a nonsteroidal anti-inflammatory drug (NSAID) that greatly reduced pain of all kinds. In 1966, they patented their creation, which was first known as 2-(4-isobutylphenyl) propionic acid and later renamed ibuprofen. While originally approved as a prescription drug in the UK, it soon became clear ibuprofen was safer and more effective than other pain relievers. It eventually hit the market as an over-the-counter medication.

During that time, Adams conducted one last impromptu experiment with the drug, which took place far outside the lab and involved only a single participant: himself.

In 1971, Adams arrived in Moscow to speak at a pharmacology conference and spent the night before his scheduled appearance tossing back shots of vodka at a reception with the other attendees. When he awoke the next morning, he was greeted with a hammering headache. So, as Smithsonian.com reports, Adams tossed back 600 milligrams of ibuprofen.

“That was testing the drug in anger, if you like,” Adams told The Telegraph in 2007. “But I hoped it really could work magic.”

As anyone who has ever been in that situation can probably predict, the ibuprofen did work magic on Adams’s hangover. After that, according to The Washington Post, the pharmaceutical company Adams worked for began promoting the drug as a general painkiller, and people started to stumble upon its use as a miracle hangover cure.

“It's funny now,” Adams told The Telegraph. “But over the years so many people have told me that ibuprofen really works for them, and did I know it was so good for hangovers? Of course, I had to admit I did.”

[h/t Smithsonian.com]