When his grandfather
Valdemar IV of Denmark died, Olaf was just five years old. He was proclaimed
king of Denmark by a
Danehof in
Slagelse the following year. His mother, Queen Margaret, was to serve as regent due to his young age. His proclamation included the title "true heir of Sweden" added at his mother's insistence since both his father and his paternal grandfather, Magnus IV, had been kings of Sweden until they were forced to
abdicate. Olaf was hailed as king in
Scania, including the towns controlled by the
Hanseatic league since the
Treaty of Stralsund in 1370. Queen Margaret signed a
coronation charter on behalf of Olaf, who was too young to rule until he came of age at fifteen. In the charter Olaf agreed to meet with the Danehof at least once a year and return properties his grandfather Valdemar IV had confiscated during his reign. Olaf became
king of Norway on his father's death in 1380. Even when Olaf reached his majority in 1385, his mother ruled through him. With his ascent to the Norwegian throne, Denmark and Norway were thus united in a personal union ruled from Denmark. Denmark and Norway would have the same king, with the exception of short
interregna, until Norway's independence from Denmark in 1814, as a result of the
Treaty of Kiel. ==Death and aftermath==