Solomon, assisted by his brother-in-law Henry IV of Germany, decided to return to Hungary in order to his restoration to the Hungarian throne against his usurper uncle Béla I.
After spending fifteen years in exile, Andrew I ascended the Hungarian throne during an extensive pagan revolt in 1046, defeating Peter Orseolo, a vassal of King Henry III of Germany.
The Illuminated Chronicle narrates that Andrew invited Béla to his manor in Várkony, where the King offered his brother a seemingly free choice between a crown and a sword (which were the symbols of the royal and ducal power, respectively).
Several historians argued the text regarding the meeting at Várkony originated in the 12th century,[4] as kind of a retrospective justification for Béla's violent usurpation of the throne.
In early 1061, Anastasia traveled to Regensburg and sought assistance from Henry IV and his German court in order to recover the Hungarian throne for his minor son.
[11] The usurper could keep his throne for three years only because the attention of the imperial councilors under the regency of dowager queen Agnes of Poitou was drawn to the events of Italian foreign policy (the election reform of Pope Nicholas II).
[13] When the most pious King Béla had completed the third year of his reign, he was severely injured on his royal estate at Dömös when his throne collapsed, and thus suffered from an incurable illness.
The emperor [Henry IV] gladly listened to his requests, and with the noble army of the Romans [Germans] and an illustrious retinue of imperial glory he led Solomon back into Hungary.
Meanwhile Géza, King Béla's son, being prudent and wary, betook himself with his two youthful brothers [Ladislaus and Lampert] to Poland for he could not at that time stand up to the assault of Solomon and the Germans.
[11][15] The German troops commanded by Otto of Nordheim, Duke of Bavaria, crossed the border sometime after 20 August 1063: Henry IV, who personally participated in the war, issued his royal charter in Erlangen on that day.
[16] Historian Ágoston Ignácz considered the German army set out for Melk – where Anastasia, Solomon's mother was in exile – on their route along the river Danube towards to Hungary.
Due to Hungarian assistance from Solomon's partisans, the imperial force this time easily crossed the natural frontier in a swampy area, according to the narration of the Annales Altahenses.
From here the castle of Moson (present-day in Mosonmagyaróvár) in the namesake county was a two-day walk away, which was laid siege and captured by the vanguard and then the arriving main army corps.
[17][18] Upon hearing the news of German invasion, Béla I was planning to abdicate in favor of his nephew if the latter restored his former ducatus,[13] but he was seriously injured when "his throne broke beneath him" in his royal manor at Dömös.
[30] Bagi remained skeptical about the authenticity of the story: Lambert was considered an opponent of Henry IV during the Investiture Controversy and gifting a sword to Otto would have been a political symbol of power in the 11th century.