What caused the Thirty Years' War?

The Thirty Years' War (1618-1648) was fought mainly along religious divisions, Catholic and Protestant, and between the competing dynasties of Bourbon (France) and Hapsburg (including Spain). The main contest was for control of central Europe, mostly the kingdoms of Germany, Austria, and the Netherlands. This area had been the domain of the Holy Roman Empire for over 600 years. The war was succeeded by the Franco-Spanish War (1635-1659).

One trigger of the war, the Bohemian Revolt, began with an event known as the (second) Defenestration of Prague. Catholic officials were mobbed by Protestants and hurled from an upper-story window in the city of Prague. The Catholics survived unharmed, and there are two versions as to why. The Catholic version is that God intervened and saved them. The Protestant version is that they landed in a heaping pile of garbage which broke their fall.