The War of the Polish Succession or the Habsburg-Polish War took place from 1587 to 1588 over the election of the successor to the King of Poland and Grand Duke of Lithuania Stephen Báthory. The war was fought between factions of Sigismund III Vasa and Maximilian III, with Sigismund eventually being crowned King of Poland and Grand Duke of Lithuania. Two major battles of this conflict included the Siege of Kraków, in which Maximilian III failed to capture the capital of the Commonwealth, and the Battle of Byczyna, in which Maximilian was forced to surrender. Sigismund's victory was significantly the doing of Chancellor and Hetman Jan Zamoyski, who stood behind both the political intrigue and the military victories of this conflict.