Anyone with a serious caffeine habit knows there's something emotionally healing about drinking hot coffee in the morning. Now there's new evidence saying that there could be something physically restorative about that first cup, too. A cup or two of coffee can offer better pain relief than a traditional over-the-counter painkiller like ibuprofen. That's according to a new study published in Nature Medicine this week from researchers at Beth Israel Deaconess Medical Center, Boston Children’s Hospital, and Harvard Medical School. Yes, a cup of coffee can make pain more bearable, especially for those suffering from chronic issues like migraines or arthritis. So how does coffee help with pain management, exactly?

The Boston-based team of researchers found that mice that were sleep-deprived became more sensitive to pain. “We found that five consecutive days of moderate sleep deprivation can significantly exacerbate pain sensitivity over time in otherwise healthy mice,” explained lead author and sleep psychologist Chloe Alexandre in a press release. And it doesn't take much sleep deprivation to reach this state; losing just one hour of sleep per night can be enough to make a difference.

When these mice were sleep-deprived and more sensitive to pain, traditional painkillers, including morphine, were less effective in relieving that pain. So the researchers gave the mice some caffeine (read: coffee), which helped with reliving some of the sensitivity. Caffeine also gave the mice a hit of dopamine, the hormone that makes you feel happy, which further dulled the feeling of pain.

There are caveats here, though. As the authors of the study write in their conclusion, "we predict that caffeine will contribute to analgesia only in sleep-deprived individuals." That's the scientific way of saying that drinking coffee will probably only help with pain management if you're also running low on sleep. And even if coffee helps with pain relief in the short-term, the only way to really deal with a sleep debt and the accompanying sensitivity to pain is to get enough sleep every night. More research is needed to fully understand this connection, the researchers admit, but hey, in the meantime, it's as good an excuse as any to drink that extra cup in the morning.