Cheb, a free imperial city since 1277, and the Imperially immediate Egerland were given as a lien to King John of Bohemia in 1322 by Emperor Louis IV of Wittelsbach. In return for John's support against Louis' rival Frederick of Habsburg at the Battle of Mühldorf, he received Eger as a "" (Imperial lien) with the "guarantee of complete independence from the Kingdom of Bohemia". This reservation however became meaningless as Louis never redeemed the pawn, and with the accession of Emperor Charles IV of Luxembourg in 1346, the crowns of the Holy Roman Empire and Bohemia were united in one hand. Charles' successors from the House of Luxembourg and (from 1526) Habsburg continuously eliminated the autonomy of the Egerland against the resistance of the Cheb citizens and the local nobility. While the present-day Franconian parts up to the Fichtelgebirge were acquired by the Principality of Bayreuth under Hohenzollern rule, the remaining territory was administrated within the Bohemian "kraj" of Loket from 1751.