The running of the school was taken over by Mr Buchanan's wife Mrs Annie Custance Buchanan following his death, aged only 48, in 1897.
Under her direction, the school broke new ground, becoming the first independent school in Edinburgh to offer a "Leaving Certificate".
The Second World War meant that most of St. Margaret's, like many other schools, had to to be evacuated and all the boarders and many of the day girls decamped to Perthshire
In 1960, the school was transferred from private ownership to a Company Limited by Guarantee, to be administered by a Board of Governors, rendering it truly independent.
In 1983, St. Margaret's merged with St. Hilary's, an offshoot of the original institution formed in 1926, reuniting two schools.
Having celebrated its centenary in 1990, the school continued to develop, adding new buildings to its campus.
In 1998, the school merged with another independent girls' school, St. Denis and Cranley.
Despite a reputation for academic excellence, rumours had circulated about the school's financial situation. Last month it was revealed that the teaching union the EIS was taking legal advice after St Margaret's announced it was to freeze teachers' pay for the next two years.