Matthias gained independence of and power over the barons by dividing them, and by raising a large royal army, Fekete Sereg (the King's Black Army of mercenaries), whose main force included the remnants of the Hussites from Bohemia. At this time Hungary reached its greatest territorial extent of the epoch (present-day southeastern Germany to the west, Dalmatia to the south, Eastern Carpathians to the east, and southwestern Poland to the north).
Soon after his coronation, Matthias turned his attention upon Bohemia, where the Hussite leader George of Poděbrady had gained the throne. In 1465 Pope Paul II excommunicated the Hussite King and ordered all the neighbouring princes to depose him. On 31 May 1468, Matthias invaded Bohemia; however, as early as 27 February 1469, he anticipated an alliance between George and Frederick by himself concluding an armistice with the former. On 3 May the Bohemian Catholics elected Matthias king of Bohemia, but this was contrary to the wishes of both pope and emperor, who preferred to partition Bohemia. George however anticipated all his enemies by suddenly excluding his own son from the throne in favor of Ladislaus, the eldest son of Casimir IV, thus skillfully enlisting Poland on his side. The sudden death of Poděbrady in March 1471 led to fresh complications. At the very moment when Matthias was about to profit by the disappearance of his most capable rival, another dangerous rebellion, headed by the primate and the chief dignitaries of the state, with the object of placing Casimir, son of Casimir IV, on the throne, paralysed Matthias's foreign policy during the critical years 1470-1471. He suppressed this domestic rebellion indeed, but in the meantime the Poles had invaded the Bohemian domains with 60,000 men, and when in 1474 Matthias was at last able to take the field against them in order to raise the siege of Breslau, he was obliged to fortify himself in an entrenched camp, whence he so skillfully harried the enemy that the Poles, impatient to return to their own country, made peace at Breslau (February 1475) on an uti possidetis basis, a peace subsequently confirmed by the congress of Olomouc (July 1479).
During the interval between these pieces, Matthias, in self-defence, again made war on the emperor, reducing Frederick to such extremities that he was glad to accept peace on any terms. By the final arrangement made between the contending princes, Matthias recognized Ladislaus as king of Bohemia proper in return for the surrender of Moravia, Silesia and Upper and Lower Lusatia, hitherto component parts of the Bohemian monarchy, till he should have redeemed them for 400,000 florins. The emperor promised to pay Matthias a huge war indemnity, and recognized him as the legitimate king of Hungary on the understanding that he should succeed him if he died without male issue, a contingency at this time somewhat improbable, as Matthias, only three years previously (15 December 1476), had married his third wife, Beatrice, daughter of Ferdinand I of Naples.
The emperor's failure to follow through on these promises induced Matthias to declare war against him for the third time in 1481. The Hungarian king conquering all the fortresses in Frederick's hereditary domains. Finally, on 1 June 1485, at the head of 8,000 veterans, he made his triumphal entry into Vienna, which he henceforth made his capital. Styria, Carinthia and Carniola were next subdued; Trieste was only saved by the intervention of the Venetians. Matthias consolidated his position by alliances with the dukes of Saxony and Bavaria, with the Swiss Confederation and the archbishop of Salzburg, establishing henceforth the greatest potentate in central Europe.
In 1471 Matthias renewed the Serbian Despotate in south Hungary under Vuk Grgurević for the protection of the borders against the Ottomans. In 1479 a huge Ottoman army, on its return home from ravaging Transylvania, was annihilated at Szászváros (modern Orăştie, 13 October 1479) in the so-called Battle of Breadfield. The following year Matthias recaptured Jajce, drove the Ottomans from northern Serbia and instituted two new military banats, Jajce and Srebernik, out from reconquered Bosnian territory. In 1480, when a Ottoman fleet seized Otranto in the Kingdom of Naples, at the earnest solicitation of the pope he sent the Hungarian general, Balázs Magyar, to recover the fortress, which surrendered to him on 10 May 1481. Again in 1488, Matthias took Ancona under his protection for a while, occupying it with a Hungarian garrison. On the death of sultan Mehmet II in 1481, a unique opportunity for the intervention of Europe in Ottoman affairs presented itself. A civil war ensued in Ottoman Empire between his sons Bayezid and Cem; the latter, being worsted, fled to the knights of Rhodes, by whom he was kept in custody in France. Matthias, as the next-door neighbour of the Ottomans, claimed the custody of so valuable a hostage, and would have used him as a means of extorting concessions from Bayezid. But neither the pope nor the Venetians would accept such a transfer, and the negotiations on this subject greatly embittered Matthias against the Papal court. The last days of Matthias were occupied in endeavouring to secure the succession to the throne for his illegitimate son János; Queen Beatrice, though childless, fiercely and openly opposed the idea and the matter was still pending when Matthias, who had long been crippled by gout, expired very suddenly on 6 April 1490, just before Easter.
At times Matthias had Vlad III Ţepeş, the Prince of Wallachia, as his vassal. Although Vlad had great success against the Ottoman armies, the two Christian rulers disagreed in 1462, leading to Matthias imprisoning Vlad in Buda. However, wide-ranging support from many Western leaders for Vlad III prompted Matthias to gradually grant privileged status to his controversial prisoner. As the Ottoman Empire appeared to be increasingly threatening as Vlad Tepes had warned, he was sent to reconquer Wallachia with Hungarian support in 1476. Despite the earlier disagreements between the two leaders, it was ultimately a major blow to Hungary's status in Wallachia when Vlad was assassinated that same year. In 1467, a conflict erupted between Matthias and the Moldavian Prince Stephen III, after the latter became weary of Hungarian policies in Wallachia and their presence at Chilia; added to this was the fact that Matthias had already taken sides in the Moldavian conflicts preceding Stephen's rule, as he had backed Alexăndrel (and, possibly, the ruler referred to as Ciubăr Vodă), deposing Petru Aron. Stephen occupied Chilia, sparking Hungarian retaliation, that ended in Matthias' bitter defeat in the Battle of Baia in December (the King himself is said to have been wounded thrice).
In the course of his expansion, Matthias strengthened his state's diplomacy. Apart from his regular network of relations with his neighbours, as well as the Pope and Kingdom of Naples, he established regular contacts with France, Burgundy, Switzerland, Florence, most German states, Russia and, occasionally, with Persia and Egypt. Matthias's empire collapsed after his death, since he had no children except for an illegitimate son, János Corvinus, whom the noblemen of the country did not accept as their king. The weak king of Bohemia, Ladislaus II of the Polish/Lithuanian Jagiellon line, followed him – Ladislaus nominally ruled the areas Matthias conquered except Austria – but real power was in the hand of the nobles. In 1514, two years before Ladislaus's death, the nobility crushed the peasant rebellion of György Dózsa with ruthless methods. As central rule degenerated, the stage was set for a defeat at the hands of the Ottoman Empire. In 1521, Belgrade fell, and, in 1526, the Hungarian army was destroyed by the Turks in the Battle at Mohács.