Spain established a vast colonial empire during the 16th and 17th centuries, holding power in the Americas and Western Pacific. However, continual wars in Europe drained Spain's resources and led to a gradual decline over the 17th century. The Spanish East Indies, consisting of the Philippines, Guam, and other islands, were ruled directly from Madrid after Mexican independence and some were later sold or occupied by other powers. The Manila galleons operated for over 250 years, transporting goods between Manila and Acapulco via the Pacific Ocean in a trade that was important to the Spanish colonies.