The hospital of Maison Dieu , dedicated to St Mary and situated near the cathedral precinct but outside the chanonry , was established by Bishop Andreas before 1237 for the aid of the poor . It suffered fire damage in 1390 and again in 1445 . The cathedral clerks received it as a secular benefice but in later years it may , in common with other hospitals , have become dilapidated through a lack of patronage . Bishop James Hepburn granted it to the Blackfriars of Elgin on 17 November 1520 , perhaps in an effort to preserve its existence . The property was taken into the ownership of the Crown after the Reformation and in 1595 was granted to the burgh by James VI for educational purposes and for helping the poor . In 1624 , an almshouse was constructed to replace the original building , but in 1750 a storm substantially damaged its relatively intact ruins . The remnants of the original building was finally demolished during a 19th @-@ century redevelopment of the area .