information:filtering, structural:scholar_edition, quality:corruption, structural:summarization, quality:correction
Dissent

The war ended in 1411 with the Peace of Thorn, in which neither Poland nor Lithuania drove home negotiating advantages home to the full, much to the discontent of the Polish nobility. Poland regained Dobrzyń Land, Lithuania regained Samogitia, and Masovia regained a small territory beyond the Wkra river. Most of the Teutonic Order's territory, however, including towns that had surrendered, remained intact. Władysław then released many high-ranking Teutonic Knights and officials for apparently modest ransoms. The cumulative expense of the ransoms, however, proved a drain on the Order's resources. This failure to exploit the victory to his nobles' satisfaction provoked growing opposition to Władysław's regime after 1411, further fueled by the granting of Podolia, disputed between Poland and Lithuania, to Vytautas, and by the king's two-year absence in Lithuania.

In an effort to outflank his critics, Władysław promoted the leader of the opposing faction, bishop Mikołaj Trąba, to the archbishopric of Gniezno in autumn 1411 and replaced him in Kraków with Vytautas supporter Wojciech Jastrzębiec. He also sought to create more allies in Lithuania. The Union of Horodło on 2 October 1413 decreed that the Grand Duchy of Lithuania was "tied to our Kingdom of Poland permanently and irreversibly", and granted the Catholic nobles of Lithuania privileges equal to those of Polish szlachta. The act included a clause prohibiting the Polish nobility from electing a monarch without the consent of the Lithuanian nobility, and the Lithuanian nobility from electing a grand duke without the consent of the Polish monarch.