Fighting started over the election of a new king for Bohemia, where there was an elective monarchy. The initial outbreak, in 1618, was a revolt against Hapsburg rule, triggered by the election of Archduke Ferdinand of Styria as heir to the childless Matthias, who was both king of Bohemia and Holy Roman Emperor. The Protestants seized power after the Defenestration of Prague (22 May 1618), and raised an army, in response to which the Emperor raised his own armies, and was engaged in indecisive war with the Bohemians. On 20 March 1619, Matthias died, leaving both thrones empty. The Bohemian electors chose Frederick V, the elector Palatinate, while the Imperial electors chose Matthias's cousin, Ferdinand of Styria, who became Emperor Ferdinand II. The fighting over Bohemia was decided in 1620. The Evangelical League (of Protestant Princes) declared neutrality, while the Catholic League sided firmly with the Emperor. At the Battle of the White Hill (8 November 1620), the Imperial forces routed the Bohemians, deposing Frederick in Bohemia, and ending the Bohemia phase of the war.
The war now moved into the Palatinate phase (1620-25). Frederick was initially successful against Imperial forces, reaching a high point at the battle of Mingolsheim, where Count Ernst von Mansfeld defeated Johan Tserclaes, Count Tilly, but the success was shortlived, and the protestant defeat at Stadtholn (6 August 1623), marked the end of true end of the Palatinate phase, leaving Frederick in exile, and Maximilian of Bavaria as the elector Palatinate. The apparent collapse of the Protestant position, and the triumph of the Hapsburgs now led to an international reaction. By the Treaty of Compiegne (10 June 1624), France and Holland allied against the Hapsburgs, soon to be joined by England, Sweden, Denmark, Savoy and Venice.
The international intervention now led to the Danish phase of the war (1625-29). Ferdinand II raised a new mercenary army, led by Count Albrecht von Wallenstein, initially to defend Hapsburg lands, but in June 1625 his commission was expanded to cover the entire Empire. This was made necessary by the invasion of Christian IV of Denmark, launched in the summer of 1625, although little of importance happened until the next year. First, France withdrew from the war after a Huguenot revolt in France, and then the Imperial forces inflicted a series of defeats on Christian of Denmark. By the summer of 1629 it again looked as if the Hapsburg-Imperial side was victorious, but once again the French took a hand. Cardinal Richelieu negotiated a peace between Sweden and Poland, which allowed Gustavus Adolphus of Sweden to enter the war on the Protestant-anti Hapsburg side.
The Swedish phase of the war (1630-35) saw more success for the anti-imperial side. Pressure from within Germany led to the dismissal of Wallenstein (August 1630), and his replacement as commander by Tilly, whose main success was the capture of Magdeburg (May 1631), after which he suffered a series of defeats, in particular at Beitenfeld (17 September 1631), and at the Battle of the Lech (14 April 1632), where he was killed. Wallenstein was once again put in charge of the Imperial forces, and although he was promptly defeated at Lutzen (16 November 1632), Gustavus Adolphus was killed during the battle. There followed a quiet phase, marked mainly by the fall of Wallenstein, who was dismissed for attempting to negotiate a peaceful settlement (1633), and finally assassinated by his own officers (25 February 1634). Defeat in battle at Nordlingen (6 September 1634) effectively ended Swedish intervention, and forcing Richelieu and France to openly take control of the Protestant war effort.
The final, French, phase of the war (1634-48), lost it's religious significance, and was in effect a struggle between France and Spain, fought out mostly in Germany. Spain still had footholds to the east of France in the Spanish Netherlands (modern Belgium) and Spanish Lombardy (northern Italy), and the French aim was to remove these Spanish outposts. Initially, the Imperial position was strong, and there was even a shortlived invasion of France (1636), but the tide of the war slowly turned against the Imperial side. The fourteen years of the French phase of the war eventually ended in exhaustion, Germany in particular having suffered year after year of campaigning. The Peace of Westphalia (24 October 1648), which ended the war, saw Hapsburg power much reduced. Alsace became part of France, while Sweden gained much of the German baltic coast, while the Emperor had to recognised the sovereign rights of the German princes, and equality between Protestant and Catholic states, while Spain, in a separate peace, finally acknowledged the independence of the Dutch Republic.