A mind-altering magic mushroom drug can treat depression by "rebooting" the brain, research suggests.
Scientists tested the drug psilocybin on 19 depressed patients who could not be helped by conventional treatments.
The patients reported an immediate mood improvement described by some as an "afterglow" effect that lasted up to five weeks.
Brain scans indicated the drug had re-set the activity of key neural circuits known to play a role in depression.
Dr Robin Carhart-Harris, head of psychedelic research at Imperial College London, said: "We have shown for the first time clear changes in brain activity in depressed people treated with psilocybin after failing to respond to conventional treatments.
"Several of our patients described feeling 'reset' after the treatment and often used computer analogies. For example, one said he felt like his brain had been 'defragged' like a computer hard drive, and another said he felt 'rebooted'."
The drug may be giving the patients the "kickstart" they need to break out of their depressive states, he said.
Similar brain effects have been seen in patients undergoing electroconvulsive therapy (ECT), a controversial treatment that triggers temporary seizures with electric shocks.
Magic mushrooms containing psilocybin and its derivative psilocin can cause hallucinations, changes in perception and an altered sense of time.
Both chemicals are classified as illegal Class A drugs in the UK, as are the mushrooms themselves.
In the study, reported in the journal Scientific Reports, patients with treatment-resistant depression were given a 10mg and 25mg doses of psilocybin seven days apart.
Functional magnetic resonance imaging (fMRI) scans showed reduced activity in certain parts of the brain after taking the drug. They included the amygdala, a small almond-shaped region known to be involved in processing emotional responses, stress and fear.
Psilocybin also induced increased stability in another brain network previously linked to depression.
The scientists warned that despite the encouraging results people with depression should not attempt to self-medicate with psychoactive drugs.