 Margaret was born in Klis Fortress in the Kingdom of Croatia, the eighth and last daughter (9th of 10 children) of the royal couple.They resided there during the Mongol invasion of Hungary (1241–42) 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.