Jan IV of Oświęcim

Despite the fact that he was the youngest brother, Jan IV received Oświęcim, the capital of the Duchy, and the towns of Kęty, Żywiec and half of Gliwice.

This has led to increased tensions between him and the Polish nobles, even resulting in some border wars (common for that period in medieval Europe).

In 1448 it seemed that the Jan IV's anti-Polish politics were definitively ended when he signed a border agreement with Kingdom of Poland: however, soon their relations worsened.

The Polish troops, under the command of Piotr Szafraniec, used this as an excuse to attack Jan IV, and sieged his castle of Barwałd.

This expedition was unsuccessful, so Jan IV withdrew to the Wolek Castle, from where he conducted trips to the Lesser Poland area.

Eventually, Jan IV accepted that he had lost all chances for victory, and in 1454 he finally agreed to sell his Duchy to the Kingdom of Poland for 20,000 groszes.

However, the Polish king, Casimir IV Jagiellon, delayed the payment of the promised amount in 1454 and he returned to his homeland with mercenaries and allies from Prussia and located his base of operations in Myślenice, and began his efforts to recover his lost Duchy.

On 27 February 1475 during a meeting in Racibórz, King Matthias arrested Jan IV, and only released him after he give up half of his lands and later.