The apes were disocvered by Primatologist Helen Morrogh-Bernard, of the University of Cambridge, UK, while studying Bornean orangutans (Pongo pygmaeus) in the Sabangau Peat Swamp Forest in Central Kalimantan, Indonesia.
In 2005, she witnessed an adult female pick a handful of leaves from a plant and then chew them, mixing the leaves with her saliva to produce a green-white lather.
The female then scooped up some of the lather with her right hand and applied it up and down the back of her left arm, from the base of the shoulder to the wrist, just as a person would apply sunscreen.
"She was concentrating on her arm only and was methodical in the way she was applying the soapy foam," said Morrogh-Bernard. "I knew this must be some form of self-medication," she added.
After using the leaves, the orangutan dropped them, allowing Morrogh-Bernard and her assistant to find out what they were.
The leaves belong to a genus called Commelina, a group of plants that orangutans do not eat as part of their normal diet.
However, local indigenous people know the plant well, grinding it into a balm and applying it to their skin to treat muscular pain, sore bones and swellings.
Chimpanzees and gorillas are thought to self medicate, mainly by swallowing rough leaves or chewed plant pith to help flush out intestinal parasites.
A few monkey species and one species of lemur are known to rub concoctions, such as tobacco, onion or garlic onto their fur to repel insects or parasites. But, wild great apes have never before been seen rubbing ointments onto their fur.
Morrogh-Bernard, who has since seen three other orangutans using the plant in the same way, said that the finding "links apes and humans directly".
According to her, the apes may not have learnt how to apply the anti-inflammatory ointment from local people, but perhaps ancestors of the indigenous population learnt about the drug from the apes.