In April 1598, Sigismund resigned as Prince of Transylvania in favor of the Holy Roman Emperor, Rudolf II (who was also the King of Hungary); reversed his decision in October 1598; and then resigned again in favor of Cardinal Andrew Báthory, his cousin. Báthory had strong ties to the Polish chancellor and hetman Jan Zamoyski and placed Transylvania under the influence of the King of Poland, Sigismund III Vasa. He was also a trusted ally of the new Moldavian Prince Ieremia Movilă, one of Michael's greatest enemies. Movilă had deposed Ştefan Rǎzvan with the help of Polish hetman Jan Zamoyski in August 1595.