The research team, led by Dr Richard Stephens, wondered whether swearing might have a psychological effect that increased pain tolerance.
To test the theory, they asked 66 volunteer students to submerge a hand into a tube of iced water for as long as possible while repeating a swear word of their choice.
At the beginning of the experiment, participants were asked for "five words you might use after hitting yourself on the thumb with a hammer". They were told to use the first swear word on the list.
The study was then conducted again, but instead of swearing the students were asked to use one of "five words to describe a table".
The researchers found that volunteers were able to keep their hands in the freezing water for significantly longer when they swore.
At the same time, their heart rates accelerated and their pain-perception, as measured with a questionnaire, reduced.
According to the researchers, swearing triggers a "fight-or-flight" response and heightens aggression.
"Everyday examples of aggressive swearing include the football manger who 'psyches up' players with expletive-laden team talks, or the drill sergeant barking orders interspersed with profanities," the Scotsman quoted the authors as saying.
"Swearing in these contexts may serve to raise levels of aggression, downplaying feebleness in favour of a more pain-tolerant machismo," they added.
"Our research shows one potential reason why swearing developed and why it persists," the Scotsman quoted Stephens as saying.
The study has been published in the journal NeuroReport.