Electroconvulsive therapy for the severely depressed works by "turning down" an overactive connection between areas of the brain, Aberdeen researchers have claimed.
ECT - which involves placing electrodes on the temples and delivering a small electrical current - has been used by psychiatrists since the 1930s.
The aim is to shock the brain and to restore its natural chemical balance.
The University of Aberdeen team hopes the findings can help treatment.
In a paper published in the journal,Proceedings of the National Academy of Sciences(PNAS), the researchers have said that the treatment appears to turn down an overactive connection between areas of the brain that control mood and the parts responsible for thinking and concentrating.
This, they argue, stops the impact that depression has on the ability to enjoy life.
The study involved using MRI scans of the brains of nine severely depressed patients before and after ECT.
Prof Ian Reid, who led the research, said: "ECT is a controversial treatment, and one prominent criticism has been that it is not understood how it works and what it does to the brain.
"However we believe we've solved a 70-year-old therapeutic riddle because our study reveals that ECT affects the way different parts of the brain involved in depression connect with one another.
"For all the debate surrounding ECT, it is one of the most effective treatments, not just in psychiatry, but in the whole of medicine, because 75% to 85% of patients recover from the symptoms."
He added: "Over the last couple of years there has been an emerging new perspective on how depression affects the brain.
"This theory has suggested a 'hyperconnection' between the areas of the brain involved in emotional processing and mood change and the parts of the brain involved in thinking and concentrating.
"Our key finding is that if you compare the connections in the brain before and after ECT, ECT reduces the connection strength between these same areas - it reduces this hyperconnectivity.
"For the first time we can point to something that ECT does in the brain that makes sense in the context of what we think is wrong in people who are depressed."
The researchers now hope to continue monitoring the patients to see if the depression and hyperconnectivity returns.
Prof Reid said: "If we understand more about how ECT works, we will be in a better position to replace it with something less invasive and more acceptable.
"At the moment only about 40% of people with depression get better with treatment from their GP.
"Our findings may lead to new drug targets which match the effectiveness of ECT without an impact on memory."
Prof David Nutt, of Imperial College London, said: "These findings make a lot of sense.
"Indeed, the disabling of connections between different areas of the brain is what I would have predicted from the depression literature.
"This is why my research group is progressing psilocybin - which also disrupts this network, as we showed in PNAS recently - as a treatment for depression."