Prince Casimir's uncle Ladislaus the Posthumous, King of Hungary and Bohemia, died in 1457 at the age of 17, without leaving an heir. Casimir's father, King Casimir IV, subsequently advanced his claims to Hungary and Bohemia, but could not enforce them due to the Thirteen Years' War (1454–66). Instead, Hungarian nobles elected Matthias Corvinus and Bohemian nobles selected George of Poděbrady as their kings. George of Poděbrady died in March 1471. In May 1471, Vladislaus, eldest son of Casimir IV, was elected to the throne of Bohemia. However, a group of Catholic Bohemian nobles supported Matthias Corvinus instead of Vladislaus II. In turn, a group of Hungarian nobles conspired against Matthias Corvinus and invited the Polish king to overthrow him. King Casimir IV decided to install his son, future Saint Casimir, in Hungary.