The realist view of world order, resting on a balance of military power, is necessary but not sufficient, because is does not take into account the long-term societal changes that have been slowly moving the world away from the Westphalian system. In 1648, after thirty years of tearing each other apart over religion the European states agreed in the Treaty of Westphalia that the ruler, in effect, would determine the religion of a state regardless of popular preference. Order was based on the sovereignty of states, not the sovereignty of peoples.