The therapy, previously tested by healthy volunteers, was used by 15 depression patients aged 23-61.
Nine reported reduced depressive symptoms a month after the therapy, of whom four experienced a clinically significant drop in depression severity, researchers said.
In the study by University College London and ICREA-University of Barcelona, patients wore a virtual reality headset to see from the perspective of a life-size 'avatar' or virtual body.
Seeing this virtual body in a mirror moving in the same way as their own body typically produces the illusion that this is their own body. This is called 'embodiment'.
While embodied in an adult avatar, participants were trained to express compassion towards a distressed virtual child. As they talked to the child it appeared to gradually stop crying and respond positively to the compassion.
After a few minutes the patients were embodied in the virtual child and saw the adult avatar deliver their own compassionate words and gestures to them.
This brief eight-minute scenario was repeated three times at weekly intervals, and patients were followed up a month later.
"People who struggle with anxiety and depression can be excessively self-critical when things go wrong in their lives," said study lead Chris Brewin from UCL.
"In this study, by comforting the child and then hearing their own words back, patients are indirectly giving themselves compassion," said Brewin.
"The aim was to teach patients to be more compassionate towards themselves and less self-critical, and we saw promising results," he said.
"A month after the study, several patients described how their experience had changed their response to real-life situations in which they would previously have been self-critical," said Brewin.
The study offers a promising proof-of-concept, but as a small trial without a control group it cannot show whether the intervention is responsible for the clinical improvement in patients.
"We now hope to develop the technique further to conduct a larger controlled trial, so that we can confidently determine any clinical benefit," said Mel Slater, professor at the ICREA-University of Barcelona.
"If a substantial benefit is seen, then this therapy could have huge potential," said Slater.
"The recent marketing of low-cost home virtual reality systems means that methods such as this could potentially be part of every home and be used on a widespread basis," he said.
The study was published in the British Journal of Psychiatry Open.
For the latest tech news and reviews, follow Gadgets 360 on X, Facebook, WhatsApp, Threads and Google News. For the latest videos on gadgets and tech, subscribe to our YouTube channel. If you want to know everything about top influencers, follow our in-house Who'sThat360 on Instagram and YouTube.