Brain scans taken of people as they were dying have revealed illuminating details of a person's final moments.
It has long been assumed that brains were largely inactive when people suffered cardiac arrests.
But EEG recordings taken of two comatose patients as they died showed high levels of activity in a part of the brain known as the temporoparietal junction.
Study author Jimo Borjigin said the scans showed "potential neuro-signatures of consciousness".
"How vivid experience can emerge from a dysfunctional brain during the process of dying is a neuroscientific paradox," she said.
"It may be activating internal covert consciousness, bringing out memories of the past, it could be a brain survival mechanism, we don't know."
The patients were all comatose and considered beyond saving. The scans were taken with the permission of families after they were taken off life support.
The two had high levels of gamma wave activity, which is normally associated with consciousness.
Two other patients who had cardiac arrests and died did not register any notable brain activity.
Stand-up comedian Cal Wilson dies aged 53
The temporoparietal junction, located towards the back of the brain, has been linked with dreaming, visual hallucinations and altered states of consciousness.
It is also associated with out-of-body experiences.
A substantial number of cardiac arrest survivors speak of having out-of-body experiences.
Sign up here to receive our daily newsletters and breaking news alerts, sent straight to your inbox.