On 18 October Michael won a decisive victory against the army of prince-cardinal Andrew Báthory at the Battle of Şelimbăr, giving him control of Transylvania. As he retreated from the battle, Andrew Báthory was killed by anti-Báthory Székely on 3 November near Sândominic and Michael gave him a princely burial in the Roman Catholic Cathedral of Alba Iulia. With his enemy dead, Michael entered the Transylvanian capital at Alba Iulia and received the keys to the fortress from Bishop Demeter Naprágyi, later depicted as a seminal event in Romanian historiography. Historian István Szamosközy, keeper of the Archives at the time, recorded the event in great detail. He also wrote that two days before the Diet met on 10 October, Transylvanian nobles "elected Michael the voivode as Prince of Transylvania". As the Diet was assembled, Michael demanded that the estates swear loyalty to Emperor Rudolf, then to himself and thirdly to his son. Even if he was recognized by the Transylvanian diet as only imperial governor subject to the Holy Roman Emperor, he was nonetheless ruler of Transylvania.