Jupiterimages, Brand X Pictures / Getty Images

Video games are more often regarded as causes of mental illness than as cures, but in a new study, a specially designed fantasy game helped teens conquer depression just as well as — if not better than — usual counseling.

Depression can be devastating among youths, yet fewer than 1 in 5 depressed teens are treated, in part because they are reluctant to seek a therapist’s help. So researchers in New Zealand created the SPARX videogame as a way to deliver cognitive behavioral therapy, packaged in a fun and appealing way. The acronym stands for “smart, positive, active, realistic and x-factor thoughts,” strategies designed to fight depression.

The game is modeled as an interactive fantasy in which players create an avatar who restores balance in a virtual world by destroying “gloomy negative automatic thoughts,” or GNATs. Cognitive behavioral therapy, or CBT, seeks to educate the depressed person that this kind of thinking is not accurate or true.

(MORE: A Blood Test to Diagnose Depression in Teens?)

When people with depression stop buying into ideas like “Everyone hates me” or “I’m a loser” and can recognize that these “GNATs” are not statements of fact about reality, but simply thoughts twisted by depression, it can stop the cycle of rumination that sustains the disease.

In the game, players’ aim is to kill creatures that represent these kinds of negative thoughts. The players move through seven levels of a fantasy world, starting in the Cave Province, which teaches basic information about depression and offers hope for recovery. Next comes the Ice Province, which promotes activity and teaches relaxation techniques. The Volcano Province provides lessons on coping with intense emotions like anger, while the subsequent Mountain, Swamp and Bridgeland regions focus on addressing specific problems and recognizing and diffusing unhelpful thoughts.

The study included 168 teens who had sought help for depression from youth health clinics, school guidance counselors or primary care doctors. Nearly two thirds were girls, reflecting the greater prevalence of the disorder in women. Their average age was about 15. Half of the group was randomly assigned to play SPARX, while the others were assigned to receive “treatment as usual,” which typically consisted of one-on-one counseling over five sessions.

About 44% of those who played SPARX recovered completely from depression, compared with 26% of those in regular treatment, a significant difference. About 66% in the gaming group showed at least a 30% reduction in symptoms, compared with 58% in usual treatment, but this difference did not reach statistical significance. Among those playing SPARX, 86% completed at least four of the “provinces” and 60% completed all seven. Interestingly, however, while 81% of the video-game players said they would recommend it to their friends, traditional therapy got a greater endorsement, with 96% recommending it to others.

(MORE: Good Grief! Psychiatry’s Struggle to Define Mental Illness Goes Awry)

The study follows up two smaller trials of the game by the same group, which found that it was superior to placebo and to being on a waiting list for treatment. The authors conclude:

It is at least as good as treatment as usual, would be cheaper and easier to disseminate and could be used to increase access to therapy. It could provide access to treatment for young people who may be reluctant to have more conventional therapy.

The authors also note that the response and recovery rates “compare favorably with other monotherapies, including antidepressants.”

A similar technique may work for adults as well as teens. A recent review of research on computerized CBT in adults looked at 22 studies and found that it was as effective as in-person therapy for depression and anxiety disorders. Indeed, the British National Health Service offers Internet-based CBT as one of its evidence-based treatments for anxiety and depression as a result of the impressive data.

While some research suggests that face-to-face therapy is important because of the supportive relationships that are forged between clients and therapists — the “active ingredient” in treatment — the success of computerized interventions suggests that perhaps that relationship is unnecessary. Although it’s clear that having strong relationships is critical to good mental health — and computerized treatments likely won’t prove to be adequate for depression if they don’t help people develop and maintain them — the current research suggests that onscreen treatment could bring relief to many teens, without the risks or stigma of antidepressant drugs or weekly therapy visits.

The study was published in BMJ.

Maia Szalavitz is a health writer for TIME.com. Find her on Twitter at @maiasz. You can also continue the discussion on TIME Healthland‘s Facebook page and on Twitter at @TIMEHealthland.