 The hospital of <unk> 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 <unk> . 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 <unk> of Elgin on 17 November <unk> , perhaps in an effort to preserve its existence . The property was taken into the ownership of the Crown after the Reformation and in <unk> was granted to the burgh by James VI for educational purposes and for helping the poor . In 1624 , an <unk> was constructed to replace the original building , but in <unk> a storm substantially damaged its relatively intact ruins . The remnants of the original building were finally demolished during a 19th @-@ century redevelopment of the area . 
