Poděbrady needed Casimir IV's support against the rebellious Catholic noblemen and their ally, Matthias Corvinus, king of Hungary. The Diet of Bohemia elected Vladislaus king after Poděbrady's death, but he could only rule Bohemia proper, because Matthias (whom the Catholic nobles had elected king) occupied Moravia, Silesia and Lusatia. Vladislaus tried to reconquer the three provinces with his father's assistance, but Matthias repelled them.