The 1618 to 1648 Thirty Years' War, that took place almost exclusively in the Holy Roman Empire has its origins, that remain widely debated, in the unsolved and recurring conflicts of the Catholic and Protestant factions. The Catholic emperor Ferdinand II attempted to achieve the religious and political unity of the empire, while the opposing Protestant Union forces were determined to defend their religious rights. The religious motive served as the universal justification for the various territorial and foreign princes, who over the course of several stages joined either of the two warring parties in order to gain land and power.