The Health Service Executive (HSE) has been given permission to allow a 16-year-old girl be treated with electroconvulsive therapy at a specialised facility in the UK.
The High Court heard she has become "almost mute" due to the combined effect of an eating disorder and severe depression.
The girl was just over seven stone when she developed anorexia during the summer of 2014.
She was struggling to make friends in a new secondary school and suffered from anxiety.
She stopped eating and began to exercise heavily. Her condition worsened and she developed severe depression.
The now 16-year-old was sent to a specialised facility in Britain just over a year ago.
She began to gain weight and became even more depressed as a result. The court heard she felt her life was not worth living and would charge into walls hoping to inflict a serious head injury.
The treatment she has received so far did not work and the High Court was asked to grant an order to allow for electroconvulsive therapy - which involves an electric current being passed through the brain under anaesthetic.
Her doctors and parents believe it to be her best chance of recovery. Mr Justice Peter Kelly felt her situation not only warranted it, but almost demanded it.