Ferdinand II was born into the Austrian branch of the House of Habsburg and educated at a school run by the Jesuits. From childhood he learned to make no compromises where religion was concerned, and when at twenty-one he took over his own lands in Styria he expelled every Protestant preacher and told the people to return to the Catholic Church or leave. Because this worked, he came to believe the same could be done across the whole empire.
When he was chosen King of Bohemia in 1617, the largely Protestant nobility there grew deeply uneasy. Two Protestant churches were indeed pulled down, and in 1618 the nobles marched into Prague Castle and threw the emperor's officials out of a window. Elected emperor the next year, Ferdinand asked his Spanish relatives and the Catholic League of Bavaria for help in crushing the revolt, and victory at the Battle of White Mountain in 1620 gave him complete control of Bohemia.
In the later 1620s, with the huge army Wallenstein had raised for him, his power reached its height. Riding that success, he issued the Edict of Restitution in 1629, ordering Protestant princes to return every piece of church property taken over the previous seventy-seven years. The order left Protestant princes desperate, and it also turned Catholic princes against him, since they had no wish to see the emperor grow so strong. Under pressure from them he dismissed Wallenstein in 1630 — at the very moment a Swedish army landed in Germany.
As the Swedes advanced he recalled Wallenstein, but when reports kept arriving that his commander was negotiating with the enemy on his own initiative, he stripped him of command in 1634 and Wallenstein was soon killed by his own officers. The following year Ferdinand made the Peace of Prague, effectively withdrawing the Edict of Restitution, in the hope of ending the war inside the empire. France entered the fighting almost at once, turning the war into a struggle between great powers rather than faiths, and he died in 1637 without seeing peace.