Margaret was born in Hungary during the exile of her father, the English prince Edward Atheling. Her mother was a Hungarian princess named Agatha. When the family was finally able to return to their homeland, Margaret spent many years at the court of her great-uncle, Edward the Confessor. But when wars with the Danes and Normans broke out, she had to flee England and seek refuge in Scotland. There she met King Malcolm III, a widower, who asked her to be his wife.
As queen, Margaret stood out for her austere life and for the great concern she showed for reforming the country, promoting religious life, encouraging culture, and supporting education. She died in Edinburgh on November 16, 1093, and was buried in Dunfermline beside her husband, who had died shortly before in the Battle of Alnwick.
She was canonized in 1249. On June 19, 1250, her body was solemnly exhumed. The date of November 10, on which the Roman liturgy had celebrated her feast since 1673, actually came from a mistaken interpretation of the earlier exhumation date.