Maximilian II, 1527–76, Holy Roman emperor (1564–76), king of Bohemia (1562–76) and of Hungary (1563–76), son and successor of Holy Roman Emperor Ferdinand I. Before acceding he evidenced a sympathy for Lutheranism that caused grave concern in imperial and papal circles and led Holy Roman Emperor Charles V to urge that his son King Philip II of Spain succeed Ferdinand. However, Maximilian yielded and in 1562 swore to remain a Catholic and to allow his immediate heirs to be educated in Spain. He thereupon was elected king of the Romans, or Holy Roman emperor-elect (1562), and king of Hungary (1563). On Ferdinand's death (1564) he took full direction of imperial affairs. He obtained funds from the diet for the defense of Austria against the Turks but did not press his advantage, and by the truce of 1568 with Selim II he agreed to continue paying tribute to the sultan for his part of Hungary. Maximilian granted a large degree of religious toleration in his Bohemian and Austrian possessions. His policy of neutrality, however, also allowed the Counter Reformation to make considerable gains in some parts of the empire. A candidate for the throne of Poland to succeed Henry of Anjou (Henry III of France), he was elected (1575) by the Polish diet as rival king to Stephen Báthory. Maximilian died, refusing the sacraments, while preparing to invade Poland. His son succeeded him as Rudolf II.