The Thirty Years War (1618-1648) was a conflict fought primarily in Germany between Catholics and Protestants. While religious differences played a role, the goals of the various powers involved were mainly geopolitical, such as German princes seeking autonomy and France attempting to limit Hapsburg power. The war occurred in phases involving Bohemia, Denmark, Sweden, and finally France and Sweden against Spain and the Holy Roman Empire. It culminated in the Peace of Westphalia, which granted sovereignty to German princes and greater religious tolerance while curbing Hapsburg power. The war devastated Germany and marked the end of the age of religious wars in Europe.