Scientists at the University of Brasilia (UnB) and Brazilian agriculture research company Embrapa have accidentally discovered a new painkiller by accident while researching something completely different.

The researchers from the two organisations were collaborating to how to improve the quality of coffee grains by combining coffee genes in new ways.

They analysed the coffee's genome sequence and discovered corresponding proteins that shared properties with those in humans.

The researchers "identified previously unknown fragments of protein — peptides — in coffee that have an effect similar to morphine, in other words they have an analgesic and sedative activity," Embrapa said.

The concept of studying the functional internal fragments of proteins is the result of a decade's worth of research by UnB that was patented in 2006 and published in the journal Plos One in 2012.

Subsequently tests on mice were carried out by Felipe Vinecky, a doctoral student in UnB's Molecular Biology Department, and the results showed that the analgesic effect lasted for four hours and no side effects were observed.

Embrapa and UnB have applied to the Brazilian government for patents for the seven proteins they have identified, which they are calling "opioid peptides".

The painkiller discovery is possible due to research conducted by Embrapa back in 2004 which succeeded in determining the sequence of coffee's functional genome and has made it possible for experiments to be conducted whereby coffee genes are combined.

"This genetic library has been extremely important for our research and we are already looking for other results with different public and private partners," said Vinecky's research supervisor Carlos Bloch Jr.