During Ladislaus IV's minority, many groupings of barons — primarily the Abas, Csáks, Kőszegis, and Gutkeleds — fought against each other for supreme power. Ladislaus was declared to be of age at an assembly of the prelates, barons, noblemen, and Cumans in 1277. He allied himself with Rudolf I of Germany against Ottokar II of Bohemia. His forces had a preeminent role in Rudolf's victory over Ottokar in the Battle on the Marchfeld on 26 August 1278.
However, Ladislaus could not restore royal power in Hungary. A papal legate, Philip, bishop of Fermo, came to Hungary to help Ladislaus consolidate his authority, but the prelate was shocked at the presence of thousands of pagan Cumans in Hungary. Ladislaus promised that he would force them to adopt a Christian lifestyle, but they refused to obey the legate's demands. Ladislaus decided to support the Cumans, for which Philip of Fermo excommunicated him. The Cumans imprisoned the legate, and the legate's partisans captured Ladislaus. In early 1280, Ladislaus agreed to persuade the Cumans to submit to the legate, but many Cumans preferred to leave Hungary.
Ladislaus vanquished a Cuman army that invaded Hungary in 1282. Hungary also survived a Mongol invasion in 1285. Ladislaus had, by that time, become so unpopular that many of his subjects accused him of inciting the Mongols to invade Hungary. After he imprisoned his wife in 1286, he lived with his Cuman mistresses. During the last years of his life, he wandered throughout the country with his Cuman allies, but he was unable to control the most powerful lords and bishops any more. Pope Nicholas IV planned to declare a crusade against him, but three Cuman assassins murdered Ladislaus.