Margaret was born in Klis Fortress in the Kingdom of Croatia, the eighth and last daughter of the royal couple. They resided there during the Mongol invasion of Hungary as her father was also ruler of this land. Her parents vowed that if Hungary was liberated from the Mongols, they would dedicate the child to religion. The three-year-old Margaret was entrusted by her parents to the Dominican monastery at Veszprém in 1245. Six years later she was transferred to the Monastery of the Blessed Virgin founded by her parents on Nyulak Szigete near Buda. She spent the rest of her life there, dedicating herself to religion and opposing all attempts of her father to arrange a political marriage for her with King Ottokar II of Bohemia. She appears to have taken solemn vows when she was eighteen years old. In marked contrast to the customs of her Order, she received the Consecration of Virgins along with some other royals to prevent further attempts on the part of her father to have her vows dispensed by the pope for marriage. Many of the details of her life are known from the Legend of Saint Margaret, written probably in the 14th century and translated from Latin to Hungarian in the 15th. The only remaining copy of the legend is in the Margaret Codex copied by the Dominican nunLea Ráskay around 1510. According to the legend, Margaret chastised herself from early childhood, wore an iron girdle, hairshirts and shoes spiked with nails performed the most menial work in the convent. The extravagance of the penances she undertook may have shortened her life. She died on 18 January 1270.
Veneration
She was venerated as a saint soon after her death, e.g., a church dedicated to her in Bocfolde, Zala County, appears in documents dated 1426. Steps were taken to procure her canonization shortly after her death, at the request of her brother King Stephen V. The necessary investigations were taken up between 1270 and 1276, but the canonization process was not successful, even though 74 miracles were ascribed to her intercession, most of them referring to curing illnesses, even someone coming back from the dead. Among those giving testimony were 27 people for whom miracles had been wrought. Unsuccessful attempts to canonize her were also made in 1640 and 1770. She was finally canonized by Pope Pius XII on November 19, 1943, at that time the feast day of her aunt, Saint Elizabeth of Hungary. Her feast day is celebrated by the Dominican Order. Raised by Pope Pius VII to a festum duplex, it is the day of her death, January 18. Her monastery was among those suppressed in 1782, part of the suppression of all monastic orders by the Emperor Joseph II. At that time, her remains were given to the Poor Clares. They were kept in Pozsony and Buda. The relics were partly destroyed in 1789 but some portions were preserved and are now kept in Esztergom, Győr, and Pannonhalma. In art Margaret is usually depicted in a Dominican nun's religious habit, holding a white lily and a book.