Near-death experiences are tricks of the mind triggered by an overload of carbon dioxide in the bloodstream, a new study suggests.

Many people who have recovered from life-threatening injuries have said they experienced their lives flashing before their eyes, saw bright lights, left their bodies, or encountered angels or dead loved ones.

In the new study, researchers investigated whether different levels of oxygen and carbon dioxide—the main blood gases—play a role in the mysterious phenomenon.

The team studied 52 heart attack patients who had been admitted to three major hospitals and were eventually resuscitated. Eleven of the patients reported near-death experiences.

During cardiac arrest and resuscitation, blood gases such as CO2 rise or fall because of the lack of circulation and breathing.

"We found that in those patients who experienced the phenomenon, blood carbon-dioxide levels were significantly higher than in those who did not," said team member Zalika Klemenc-Ketis, of the University of Maribor in Slovenia.

CO2 Only Common Factor in Near-Death Experiences

Other factors, such a patient's sex, age, or religious beliefs—or the time it took to revive them—had no bearing on whether the patients reported near-death experiences.

The drugs used during initial treatment—a suggested explanation for near-death experiences after heart attacks—also didn't seem to correlate with the sensations, according to the study authors.

How carbon dioxide might actually interact with the brain to produce near-death sensations was beyond the scope of the study, so for now "the exact pathophysiological mechanism for this is not known," Klemenc-Ketis said.

However, people who have inhaled excess carbon dioxide or have been at high altitudes, which can raise the blood's CO2 concentrations, have been known to have sensations similar to near-death experiences, she said. (Related: "High-Altitude Suits Keep Pressure on Pilots.")

A Glimpse of the Afterlife?

The study is among the first to find a direct link between carbon dioxide in the blood and near-death experiences, or NDEs, said Christopher French, a psychologist at the Anomalistic Psychology Research Unit of the University of London, who was not involved in the new research.

The hospital study bolsters previous lab work done in the 1950s that found "the effects of hypercarbia [abnormally high levels of CO2 in the blood] were very similar to what we would now recognise as NDEs," French said in an email.

The research also supports the argument that anything that disinhibits the brain—damages the brain's ability to manage impulses—can produce near-death sensations, he said. Physical brain injury, drugs, and delirium have all been associated with a disinhibited state, and CO2 overload is another potential trigger.

Still, not all scientists are convinced: "The one difficulty in arguing that CO2 is the cause is that in cardiac arrests, everybody has high CO2 but only 10 percent have NDEs," said neuropsychiatrist Peter Fenwick of the Institute of Psychiatry at Kings College London.

What's more, in heart attack patients, Fenwick said, "there is no coherent cerebral activity which could support consciousness, let alone an experience with the clarity of an NDE."

The main alternative is that near-death experiences are "evidence of consciousness becoming separated from the physical substrate of the brain, possibly even a glimpse of an afterlife," the University of London's French noted.

But for him, at least, "the latest results argue strongly against such a hypothesis."