"Patients who have had a stroke or heart attack are prone to suffer from low mood and are two to three times more likely to develop clinical depression, which then further elevates their risk of future heart attacks and strokes," said senior author Doug McEvoy, a sleep researcher at Flinders University in Adelaide, Australia.

His team analyzed data from nearly 2,700 patients with obstructive sleep apnea (OSA) and moderate-to-severe heart disease who were enrolled in the Sleep Apnea Cardiovascular Endpoints (SAVE) trial.

"After following them for an average of 3.7 years, we found that CPAP provided significant reductions in depression symptoms compared with those who were not treated for OSA. The improvement for depression was apparent within six months and was sustained," study first author Danni Zheng said in a Flinders news release. She is a postdoctoral research fellow at the George Institute for Global Health in Sydney, Australia.

Patients who had lower mood scores to begin with appeared to get the greatest mood-related benefit from CPAP use, the authors said.

Their study -- described as the largest of its kind and one of only a few to examine how CPAP affects mood in heart patients -- was recently published in the journal EClinicalMedicine.

The patients studied were enrolled in the SAVE trial based solely on their history of heart disease, not their mood, Zheng noted.

Up to 50% of heart disease patients have sleep apnea, so it's "welcome news that treatment of OSA substantially relieves cardiovascular patients' depressive symptoms and improves their well-being," McEvoy said.

The findings could lead to use of CPAP to combat depression, even in people who don't have sleep apnea, according to the researchers.