Prayers offered by strangers had no effect on the recovery of people who were undergoing heart surgery, a large and long-awaited study has found.

And patients who knew they were being prayed for had a higher rate of post-operative complications like abnormal heart rhythms, perhaps because of the expectations the prayers created, the researchers suggested.

Because it is the most scientifically rigorous investigation of whether prayer can heal illness, the study, begun almost a decade ago and involving more than 1,800 patients, has for years been the subject of speculation.

The question has been a contentious one among researchers. Proponents have argued that prayer is perhaps the most deeply human response to disease, and that it may relieve suffering by some mechanism that is not yet understood. Skeptics have contended that studying prayer is a waste of money and that it presupposes supernatural intervention, putting it by definition beyond the reach of science.