The Spanish Empire slowly lost power, as it gradually lost territory to other empires. In 1648, Spain and many other powers signed the Peace of Westphalia, which ended both the Thirty Years' War and the Eighty Years' War. In 1659, the Treaty of the Pyrenees ended fighting between France and Spain. With these treaties, Spain began to lose its status as hegemonic power in Europe.