A young woman with anorexia left a hospital where she was regaining weight because she was determined to go to university, an inquest heard.
Averil Hart, 19, had an eating disorder unit admission at Addenbrooke's Hospital, Cambridge before going to university in September 2012.
She died in December 2012, eight days after being found collapsed in her room at the University of East Anglia.
A doctor described the university offer as a "massive motivation for her".
Miss Hart, of Newton in Suffolk, began a creative writing course at the University of East Anglia (UEA) in Norwich in September 2012, having left the eating disorder unit the previous month after a 10-month admission.
The inquest has heard Miss Hart lost weight during her first term and was found collapsed in her room on 7 December, before she died at hospital in Cambridge on 15 December.
Dr Jane Shapleske, a consultant psychiatrist for Cambridgeshire and Peterborough NHS Foundation Trust, told an inquest: "There was no pressure for her that she needed to go at the beginning of August."
She said Miss Hart was deemed to be at high risk of relapse but "worked best when she came forward with her own plan".
Dr Shapleske ruled out detaining Miss Hart under the Mental Health Act, and added that remaining in hospital to regain more weight with increasing periods of home leave would have meant she would not have gone to university.
She added if Miss Hart was discharged home to work with services in the community then "boredom and lack of structure was a risk factor".
Referring to Miss Hart's decision to leave hospital and go to university, Dr Shapleske said: "We were in a very difficult position because she decided on a course of events that was risky.
"What we did at the time was do our best to provide a solution so she had a point of contact that she had a really good relationship with and she had medical monitoring at the GP surgery."
The inquest continues.
If you are affected by any of the issues in this story, you can talk in confidence to eating disorders charity Beat by calling its adult helpline on 0808 801 0677 or youth helpline on 0808 801 0711.