Maximilian received his education in Spain.
Charles V had to give the imperial succession of Ferdinand I, but he had tried to reserve the succession of Ferdinand for his own son Philip II of Spain rather than Maximilian. This created a deep division between the two main branches of the Hapsburg family; in 1551 Ferdinand and Maximilian had to yield to Charles V's wishes, although they did not plan to keep the agreement. A complicating factor was that Maximilian's Catholicism was suspect; he was on very good terms with the German princes who had defeated Charles V in 1552.
After Ferdinand succeeded Charles V in 1555, he tried to bring Maximilian back to the Catholic Church. In spite of his insistence and threats from Pope Paul IV, Maximilian kept his Lutheran chaplain. In 1560 relations with his father were near a rupture, and he canvassed the Protestant princes for their support against his father. When he found this support lacking, Maximilian gave in and nominally returned to Catholicism. Maximilian's behavior remained ambiguous, and it was anticipated that he would favor Protestantism if he ever became emperor.
In 1562 Ferdinand had Maximilian elected king of the Romans, thus securing his succession and overriding the earlier settlement in favor of Philip II. In 1564 Maximilian succeeded his father as emperor. He was now in a unique position to help Protestantism win in the empire. But his was a peaceful and vacillating character, and he was not up to the historical role he might have played. All he did was to work for a piecemeal reform of the Church, favoring the lay cup and priestly marriage; in his own Austrian lands he introduced a large measure of religious freedom in 1568.
Maximilian II's dealings with the German Protestants were made more difficult by the ferocious dogmatic hostilities between the several Lutheran sects and between the Lutherans and Calvinists. His continued wavering was certainly influenced by political interests as well; as emperor, he did not want to include in the Augsburg Peace of Religion ecclesiastical princes turned Lutheran, as he had promised the princes before. He also attended vigilantly to dynastic interests. In order to placate the Spanish family, and with an eye on the Spanish succession, he sent his oldest son, Rudolph, to Spain for a solid Catholic education.
As was the case with all the emperors of the period, the Turkish threat in Hungary determined much of Maximilian's policy toward the German princes and foreign powers. He tried to remain at peace with the Sultan and abandoned all attempts to roll back the Turkish inroads.
In 1575 Maximilian became involved in intrigues to win the Polish crown for his house, but he died before he could prepare the military campaign to unseat another pretender. The year before, however, he had yielded to Spanish demands and had obtained the designation of his Catholic son Rudolph II as his successor, thus securing the Catholic future of the Hapsburg lands and of the imperial office.
Maximilian’s sympathies for Lutheranism, formed in his youth, eventually caused sufficient scandal in Habsburg circles for his father to threaten him with exclusion from the succession in 1559. Henceforth, although he paid lip service to Roman Catholicism, he remained basically a humanist Christian who favoured compromise between the rival confessions.
In 1548 Maximilian married his cousin Maria, daughter of Charles V. The marriage was a happy one. The couple had sixteen children. Their daughter Anna became a Queen of Spain, and the sons Rudolf I and Matthias were Holy Roman Emperors.