The youngest daughter of King Valdemar IV of Denmark, Margaret was born at the Søborg Castle. She was a practical, patient administrator and diplomat, albeit one of high aspirations and a strong will, who intended to unite Scandinavia forever into one single entity with the strength to resist and compete against the might of the Hanseatic League. She did not leave any biological heirs, with the early demise of her only son, though some historians suggest she had an illegitimate daughter with Abraham Brodersson. Margaret was ultimately succeeded by a string of incompetent monarchs, despite her efforts to raise and educate her heir Eric of Pomerania and his bride Philippa of England. Philippa in particular was an excellent pupil, but died young. Ultimately, the Union into which she put so much effort and hope gradually disintegrated.
Some historians have criticized Margaret for favouring Denmark and being too autocratic, though she is generally thought to have been highly regarded in Norway and respected in Denmark and Sweden. She was painted in a negative light in contemporary religious chronicles, as she had no qualms suppressing the Church to promote royal power.
Margaret is known in Denmark as "Margrethe I" to distinguish her from the current queen, who chose to be known as Margrethe II in recognition of her predecessor.
Margaret was born in March 1353 as the sixth and youngest child of King Valdemar IV and Helvig of Schleswig. She was born in the prison of Søborg Castle, where her father had already confined her mother. She was baptised in Roskilde and in 1359, at the age of six, engaged to the 18-year-old King Haakon VI of Norway, the youngest son of the Swedish-Norwegian king Magnus IV & VII. As part of the marriage contract it is presumed that a treaty was signed ensuring Magnus the assistance of King Valdemar in a dispute with his second son, Eric "XII" of Sweden, who in 1356 held dominion over Southern Sweden. Margaret's marriage was thus a part of the Nordic power struggle. There was dissatisfaction with this in some circles, and the political activist Bridget of Sweden described the agreement in a letter to the Pope as "children playing with dolls". The goal of the marriage for King Valdemar was regaining Scania, which since 1332 had been mortgaged to Sweden. Per contemporary sources, the marriage contract contained an agreement to give Helsingborg Castle back to Denmark, but that was not enough for Valdemar, who in June 1359 took a large army across Øresund and soon occupied Scania. The attack was ostensibly to support Magnus against Erik, but in June 1359, Erik died. As a result, the balance of power changed, and all agreements between Magnus and Valdemar were terminated, including the marriage contract between Margaret and Haakon.
This did not result in the withdrawal of Valdemar from Scania; he instead continued his conquests on the island of Gotland in the Baltic Sea. Visby, which was populated by Germans, was the main town on the island and was the key to domination of the Baltic Sea. On 27 July 1361 a battle was fought between a well-equipped Danish army and an array of local Gotland peasants. The Danes won the battle and took Visby, while the Germans did not take part. King Magnus and the Hanseatic League could not disregard this provocation, and a trade embargo against Denmark was immediately enacted, with agreement about necessary military action. At the same time, negotiations opened between King Magnus and Henry of Holstein about a marriage between Haakon and the latter's sister Elizabeth. On 17 December 1362, a ship left with Elizabeth bound for Sweden. A storm, however, diverted her to the Danish island Bornholm, where the archbishop of Lund declared the wedding a violation of church law because Haakon had already been engaged to Margaret. The Swedish and Hanseatic armies also ultimately withdrew from their siege of Helsingborg. Following this, a truce was concluded with the Hanseatic States and King Magnus abandoning the war, meaning the marriage of the now 10-year-old Margaret and King Haakon was again relevant. The wedding was held in Copenhagen on 9 April 1363.