The Thirty Years' War (1618-1648) began in Bohemia, where the Protestant estates feared the Catholic Habsburg succession would revoke their religious liberties, guaranteed by the Letter of Majesty of 1609. In May 1618 Bohemian nobles threw two imperial governors from a window of Prague Castle, the Defenestration of Prague, and set up a rebel state, crowning the Calvinist Frederick V of the Palatinate 'the Winter King'. The Catholic League and Spain crushed the revolt at the White Mountain (1620), and the Palatinate itself was conquered, turning a Bohemian rebellion into a European war as Denmark, then Sweden, then France intervened against the Habsburgs.
Under Emperor Ferdinand II the Catholic powers nearly won outright. Wallenstein's imperial armies and Tilly's Leaguers defeated the Danes at Lutter (1626) and drove them from the war (Peace of Lubeck, 1629), and the Edict of Restitution (1629) ordered Protestant lands confiscated since 1552 returned to the church. The overreach provoked Gustavus Adolphus of Sweden, financed by France, to intervene: his reformed army smashed Tilly at Breitenfeld (1631), swept through Germany, and fell at Lutzen (1632) even in victory. After Wallenstein's assassination in 1634, imperial arms recovered at Nordlingen, but in 1635 Catholic France declared war on Spain openly, and the conflict became a general struggle for the mastery of Europe.
The last thirteen years were the most devastating. Armies of all sides, paid late or never, lived off the land, plundering, burning and spreading famine and plague across Germany. Swedish victory at Wittstock (1636), French victory at Rocroi over the Spanish infantry (1643), and the devastation of regions like the Palatinate and Magdeburg, sacked in 1631 with the loss of most of its people, made the war a byword for horror. Germany lost perhaps a quarter to a third of its population, some regions far more, and the economy of the Holy Roman Empire was set back generations.
Exhaustion brought the Peace of Westphalia (1648), negotiated at Munster and Osnabruck. The settlement confirmed the near-sovereignty of the Empire's princes, including their right to foreign alliances, recognized Calvinism alongside Catholicism and Lutheranism, and awarded Sweden western Pomerania and France lands in Alsace; Switzerland and the Dutch Republic were recognized as independent. Westphalia is conventionally taken to found the European order of sovereign states: it ended the ideal of a unified Christian empire, made France the leading continental power, weakened Habsburg Spain decisively, and established that religious uniformity would no longer decide international politics.