Hungarian Defence Forces
In April 1867, the Austro-Hungarian Empire was established. Franz Josef, the head of the ancient Habsburg dynasty, was recognized as both Emperor of Austria and King of Hungary. Nevertheless, the issue of what form the Hungarian military would take remained a matter of serious contention between Hungarian patriots and Austrian leaders. As the impasse threatened the political union, Emperor Franz Josef ordered a council of generals in November of the same year. Ultimately, the leaders resolved on the following solution: in addition to the joint (k.u.k.) army, Hungary would have its own defence force, whose members would swear their oath to the King of Hungary (who was also Emperor of Austria) and the national constitution, use the Hungarian language of command, and display their own flags and insignia. (Austria would also form its own parallel national defence force, the "Landwehr".) As a result of these negotiations, on 5 December 1868, the Royal Hungarian Landwehr ("Magyar Kiralyi Honvédség", or Defence Force) was established.
Austrian–Hungarian War (1477–1488)
Matthias and Frederick III/V had been rivals stretching back to Matthias' succession as King of Hungary in 1458 after the early death of Frederick's Habsburg cousin King Ladislaus the Posthumous. At this time, Frederick held the Holy Crown of Hungary and was a candidate for becoming Hungarian king himself. Matthias, backed by the Bohemian king George of Poděbrady whose daughter Catherine (1449–1464) he married in 1461, finally prevailed: the two rivals settled their disagreements in 1463 with the Treaty of Wiener Neustadt, in which Frederick recognized the "de facto" King of Hungary and returned the Holy Crown to Matthias for a heavy ransom.