After the death of King Alexander I, Sigismund arrived in Vilnius, where he was elected by the Lithuanian Ducal Council on 13 September 1506 as Grand Duke of Lithuania, contrary to the Union of Mielnik (1501), which proposed a joint Polish-Lithuanian election of a monarch. On 8 December 1506, during the session of the Polish Senate in Piotrków, Sigismund was elected King of Poland. He arrived in Kraków on 20 January 1507 and was crowned four days later in Wawel Cathedral by Primate Andrzej Boryszewski.