It was saved from closure at the eleventh hour less than four years ago.
But now some of its pupils are hoping to carve out a career in the arts thanks to a partnership with one of the nation’s flagship cultural events.
They hosted their own launch event to showcase the programme of this year’s Edinburgh International Festival after shadowing key staff over the last three years.
And this summer they will run their own pop-up up venue for performances by one of the biggest dance acts at the event - in their gym hall.
Pupils and parents joined forces to halt plans by Edinburgh City Council chiefs to shut down Castlebrae Community High due to some of the poorest exam results and truancy rates in the country.
Within months its new headteacher, Norma Prentice, had agreed to let its pupils go on regular visits to the festival’s headquarters on the Royal Mile as part of a mentoring programme, while regular workshops were held in the school itself.
All 130 pupils have been involved in the project, instigated by festival director Fergus Linehan on his arrival in the autumn of 2014.
Ms Prentice said: “The school was in quite a bad place when I arrived. There were no aspirations, there was no confidence, and there was no fun about the place.
“Projects very often only target a set number of pupils, but the festival has really been at the heart of the whole school community over the last three years and I think it has really planted a lot of seeds for future careers, which we’re now planning to track.
“This project has brought a wide-range of opportunities to the pupils, which wouldn’t normally be available to them, given them real confidence and it has also been great fun for everyone.
“The festival offered all kinds of work experience opportunities at its headquarters on the Royal Mile, including the box office and on the catering side, showing the pupils all the careers that are available to them, and that is not just about being a top-class performer.”
Sally Hobson, head of creative learning at the festival, said: “We had worked with Castlebrae before and we felt that the particular nature of the school, because it had a small roll and also the fact it had just had a reprieve gave us a really good opportunity to develop a meaningful relationship with the pupils.
“I’ve noticed a huge difference. The school was very unsettled back three years ago. They pupils didn’t have any real security or sense of future and they have that now.
“A lot it is down to work with in the local community and the school building up relationships between the teachers and pupils. We’d like to think we’ve had a real impact on that, as well as having a direct influence on the children.
"Some of the senior students were right in the middle of the period of difficulty the school had. They’ve suffered quite a lot. It’s been good to have an intense relationship with them, to help them consider how they might look at their futures and not give up.”
One student Alan Swinton, 17, said: “I’m really interested in working in the industry now, especially the whole technical side of it. I didn’t really understood any of it before. In my I head I just thought you put on a show and that was it.”