On January 24, 1588, the army of Maximilian Habsburg was defeated by Jan Zamoyski in the Battle of Byczyna. Maximilian, together with his court, was interned in Krasnystaw. The conflict was ended in early spring of 1589, during the so-called Pacification Sejm. Supporters of Maximilian swore their allegiance to Sigismund, and were allowed to return to the Commonwealth.