Matthias, 1557–1619, Holy Roman emperor (1612–19), king of Bohemia (1611–17) and of Hungary (1608–18), son of Holy Roman Emperor Maximilian II. He was appointed governor of Austria (1593) by his brother, Holy Roman Emperor Rudolf II. He formed a close association there with the bishop of Vienna, Melchior Klesl, who later became his chief adviser. In 1605, Matthias forced the ailing emperor to allow him to deal with the Hungarian Protestant rebels. The result was the Peace of Vienna (1606), which guaranteed religious freedom in Hungary. In the same year Matthias was recognized as head of the house of Hapsburg and as future Holy Roman emperor, as a result of Rudolf's illness. Allying himself with the estates of Hungary, Austria, and Moravia, Matthias forced (1608) his brother to yield rule of these lands to him; Rudolf later ceded (1611) Bohemia. After Matthias's accession as Holy Roman emperor, his policy was dominated by Klesl, who hoped to bring about a compromise between Catholic and Protestant states within the empire in order to strengthen it. Matthias had already been forced to grant religious concessions to Protestants in Austria and Moravia, as well as in Hungary, when he had allied with them against Rudolf. His conciliatory policies were opposed by the more intransigent Catholic Hapsburgs, particularly Matthias's brother Archduke Maximilian, who hoped to secure the succession for the inflexible Catholic archduke Ferdinand (later Holy Roman Emperor Ferdinand II). The start of the Bohemian Protestant revolt in 1618 provoked Maximilian to imprison Klesl and revise his policies. Matthias, old and ailing, was unable to prevent a takeover by Maximilian's faction. Ferdinand, who had already been crowned king of Hungary (1617) and of Bohemia (1618), succeeded Matthias as Holy Roman emperor.