Margaret was born into royalty in Hungary around 1045. Her father was Edward Atheling, heir to the English throne, and her mother was Princess Agatha of Hungary. Her family returned to England when she was 10 years old, but the Norman Conquest forced them into exile. By this time, her father had died, and her mother fled with the children. They boarded a ship which crashed onto the coast of Scotland, where they remained.
In 1070, at the age of 25, Margaret married the king of Scotland, Malcolm Canmore. As queen, Margaret's faith had a strong influence on her husband’s reign. She softened his temper and led him to practice virtue. She dignified the court, providing an example of purity and reverence that led others to follow in her path. She and the king prayed together and fed the hungry, offering a powerful witness of faith to the people they served.
In addition to being a model wife and mother, Margaret worked tirelessly to bring justice and relief to the poor of Scotland. She also built churches and encouraged practices of religious devotion. In her private life, she exhibited great prayerfulness and piety. Her influence was seen not only in her husband's life, but throughout all of Scotland.
Margaret died in 1093, just four days after her husband and one of her sons were killed in battle. She was canonized in 1250 by Pope Innocent IV and named patron of Scotland in 1673.