If your job is a literal pain in the neck, drinking coffee may help, a new study from Norway says.

People who drank coffee before sitting down to work at a computer for 90 minutes reported less pain in their necks and shoulders than those who didn’t drink coffee, according to the study. Some in the study had previously suffered chronic neck and shoulder pain, while other participants hadn’t — but people in both groups who drank coffee reported less pain, the researchers said.

Among people whose daily work involves low levels of muscle activity, such as sitting at a computer all day, about 10 percent report shoulder and neck pain, according to the study.

The researchers looked at 48 people, including 22 with chronic neck or shoulder pain, and 26 healthy people. The experiment was part of research on how pain develops during office work; it was not intended to look at the effects of caffeine, the researchers said.

People in the study reported to the laboratory first thing in the morning, so to offset any effects of sleepiness, coffee and tea were available. Nineteen of the study participants chose to drink either coffee or tea, but were instructed not to drink more than one cup.

Then, for 90 minutes, participants performed a computer task, using only a mouse.

Researchers found that people who drank coffee — whether they had previous chronic pain or not — developed less pain over the course of the 90 minutes, compared with those who didn’t drink coffee. And at the end of the computer task, the coffee drinkers rated their pain as less intense than the other study participants.