Supplements of cocoa flavonols could also be created to ease diarrhoea symptoms, they say.
Cocoa has been used as a natural remedy for diarrhoea dates since the 16th century but the new study is the first to investigate how it actually works.
Researchers from the Children's Hospital & Research Center in Oakland, US and the Heinrich Heine University in Germany showed in lab tests that cocoa flavonoids can bind to and inhibit a protein in the intestines called CFTR, which regulates fluid secretion in the small intestines.
Writing in the October issue of the Journal of Nutrition (vol 135, pp2320-2325), they describe how they tested both cocoa extract and flavonoids alone in cell cultures that mimic the lining of the intestine. All of the cultures reported lower fluid levels.
"Our study presents the first evidence that fluid loss by the intestine can be prevented by cocoa flavonoids," said one of the study authors, Dr Horst Fischer, an associate scientist at the Oakland centre.
"Ultimately, this discovery could lead to the development of natural treatments that are inexpensive, easy to access and are unlikely to have side effects."
Diarrhoea is a common condition that causes an average of 2.4 million doctor's visits in the US each year. Children younger than the age of five and the elderly can develop severe health problems if their condition leads to dehydration.
Cocoa compounds are increasingly being investigated as supplements or functional food ingredients, particularly by confectionery giant Mars. The company is developing a range of products rich in flavonols that are designed to improve health.