Under King Charles V, the Spanish Empire was powerful and prosperous, but began declining under King Phillip II in the mid-16th century as Spain's economic wealth depleted due to agricultural and trade failures. They colonized the Philippines but it became another burden. The Treaty of Westphalia in the late 16th century organized economic cooperation between empires through circulating trade, though it did not eliminate all territorial conflicts. The largest traded commodities were slaves, who were crucial to agriculture and trade goods and were used as an economic crutch by European empires from the 1400s to the 1870s.