Magnus is an illegitimate son of King Olaf Haraldsson (later St. Olaf), by his English concubine Alfhild, originally a slave (thrall) of Olaf's queen Astrid Olofsdotter.
Born prematurely, the child was weak and unable to breathe for the first few minutes, and he was probably not expected to survive.
Olaf was not present at the child's birth, and his Icelandic skald Sigvatr Tordarson became his godfather.
In a hasty baptism, Sigvatr named Magnus after the greatest king he knew of, also Olaf's greatest role model, Karla Magnus, or Charlemagne.
Against the odds, Magnus had gone on to grow strong and healthy, and he had become of vital importance to Olaf as his only son.
When Olaf was dethroned by the Danish king Cnut the Great in 1028, he had gone into exile with his family and court, including the young Magnus.
They had traveled over the mountains and through Eidskog during the winter, entered Värmland, and had been given shelter by a chieftain called Sigtrygg in Närke.
After a few months, they departed Närke, and by March went eastwards towards Sigtuna, where the Swedish king Anund Jacob had left them a ship.
The party thereafter sailed through the Baltic Sea and into the Gulf of Finland, eventually landing in Kievan Rus' (Gardaríki).
They had made their first stop at Staraya Ladoga (Aldeigjuborg) to organize the further journey.
From there, they had traveled southwards to Novgorod (Holmgard), where Olaf had sought assistance from Grand Prince Yaroslav the Wise.
Yaroslav, however, had not wanted to become directly involved in the Scandinavian power-struggles, and declined to help.
After some time, in early 1030, Olaf had learned that the Earl of Lade Håkon Eiriksson, Cnut's regent in Norway, had disappeared at sea, and gathered his men to make a swift return to Norway.
Magnus was left to be fostered by Yaroslav and his wife Ingegerd.
A party including Magnus's uncle Harald Sigurdsson (later also to be king and then known as Harald Hardrada) had arrived in early 1031 to report the news of his father's death at the Battle of Stiklestad.
Magnus had for the past few year been educated in Old Russian and some Greek and has been trained as a warrior.
After Cnut's death in 1035, the Norwegian noblemen do not want to be under the oppressive rule of his son Svein and his mother Ælfgifu (known as Álfífa in Norway) any longer.
Einar Thambarskelfir and Kalf Arnesson, who had both sought to be appointed regents under Cnut after Olaf's death in 1030 (Cnut had instead appointed Svein and Ælfgifu), go together to Kievan Rus' to bring the boy back to rule as the King of Norway.