In the course of War of the Polish Succession, Archduke Maximilian III of Austria was soundly defeated and taken prisoner by Polish chancellor and hetman, Jan Zamoyski, at the Battle of Byczyna in January 1588. Maximilan was treated with courtesy, but nonetheless found himself imprisoned in Commonwealth for over a year; first at Krasnystaw, than at Zamość. His lengthy captivity was a result of a political game played by chancellor Zamoyski, who treated him as useful leverage in international negotiations between Poland, Austria, Sweden and Russia.