Béla, who had been Andrew's heir before Solomon's coronation, left for Poland in 1059; his sons accompanied him. They returned with Polish reinforcements and began a rebellion against Andrew. After defeating Andrew, Béla was crowned king on 6 December 1060. Solomon left the country, taking refuge in the Holy Roman Empire. Béla I died on 11 September 1063, some time before German troops entered Hungary in order to restore Solomon. Ladislaus and his brothers, Géza and Lampert, went back to Poland, and Solomon was once again crowned king in Székesfehérvár. The three brothers returned when the Germans left Hungary. To avoid another civil war, the brothers signed a treaty with Solomon on 20 January 1064, acknowledging Solomon's reign in exchange for their father's duchy.