Saint Margaret was born in Hungary in 1046 and came to live in England at the age of ten. However she fled to Scotland in 1068 because her younger brother Edgar Atheling was a challenge to the ruling Norman dynasty. She arrived in Scotland as a penniless and landless political exile.
King Malcolm III asked for her hand in marriage probably because a marriage alliance with a dispossessed English dynasty could potentially be turned to his advantage. As it turned out they seem to have had a loving relationship which produced eight children, including future King David I.
St Margaret is credited with bringing Benedictine monks to Scotland and starting the process of ecclesiastical reform. She helped stimulate overseas trade and many new luxury goods became available during this period. She gave gifts to churches, established a ferry at Queensferry (hence the name) and even spoke at reforming councils. She also improved the court of the king by introducing some of the finer European manners and traditions.
Margaret was canonised by Pope Innocent IV in 1251. She had been buried alongside Malcolm in Dunfermline Abbey in 1093 and reportedly miracles took place in and around her tomb. St Margaret's chapel which was built by her son in the 12th century is the oldest building in Edinburgh Castle.
In 1297 her body was removed from Dunfermline Abbey. Mary, Queen of Scots rather bizarrely reportedly owned the head of St Margaret for a while but after being transported abroad her remains were lost.