The Thirty Years' War was a conflict fought between the years 1618 and 1648, principally in the central European territory of the Holy Roman Empire, but also involving most of the major continental powers. It occurred for a number of reasons, although it was from its outset a religious conflict between Protestants and Catholics, the self-preservation of the Habsburg dynasty was the central motive.
The devastation caused by the war has long been a subject of controversy among historians. Estimates of mass civilian casualties of up to thirty percent of the population of Germany are now treated with caution. It is almost certain that the war caused serious dislocation to the economy of central Europe, but may have done no more than seriously exacerbate changes in the terms of trade caused by other factors.
The immediate result of the war, however, which was to endure for around two centuries, was the enshrinement of a Germany divided among many territories, all of which, despite their continuing membership of the Empire up to its formal dissolution in 1806, had de facto sovereignty. It has been speculated that this weakness was a long-term underlying cause of later German militarism.
The Thirty Years' War rearranged the previous structure of power. Spain's decadence became truly visible. While Spain was preoccupied with France during the French Period, Portugal declared itself independent (it was under Spanish control since Philip II had taken control through a weak claim for it after its king had died without an heir). The Braganza family became the new leaders of Portugal and produced King John IV of Portugal as its leader. France was now seen to be the dominating power in Europe.
During the last years of the Thirty Years' War Sweden was involved in a conflict with Denmark between 1643-1645, called the Torstenson War. The favourable outcomes of that conflict and the conclusion of the great European war at the Treaty of Westphalia in 1648 helped establish post-war Sweden as a great power in Europe.
The edicts agreed upon during the signing of the Treaty of Westphalia were instrumental in laying the foundations for what are even today considered the basic tenets of the sovereign nation-state. Aside from establishing fixed territorial boundaries for many of the countries involved in the ordeal (as well as for the newer ones created afterwards), it was agreed that the citizenry of a respective nation were subject first and foremost to the laws and whims of their own respective government rather than to those of neighboring powers, be they religious or secular. This certainly contrasted sharply with earlier times where overlapping political and religious loyalties were commonplace.