 This marked the end of this conflict.After the intervention of a papal envoy, Maximilian was released, but only after spending thirteen months as a "guest" of Zamoyski.In the Treaty of Bytom and Będzin (signed on 9 March 1589) Maximilian had to renounce the Polish crown and Rudolf II, Holy Roman Emperor had to pledge not to make any alliances against Poland with Muscovy or Sweden.