Spanish East Indies together with the Spanish West Indies, were administered through the Viceroyalty of New Spain based in Mexico City. After Mexican independence, they were ruled directly from Madrid. As a result of the Spanish–American War in 1898, the Philippines and Guam were occupied by the United States while about 6,000 of the remaining smaller islands were sold to Germany in the German–Spanish Treaty of 1899. The few remaining islands were ceded to the United States when the Treaty of Washington was ratified in 1901. Spanish contact began on , when a Spanish expedition led by Ferdinand Magellan reached the Mariana Islands.
Dutch East Indies East Indies. In 1811 Daendels was replaced by Governor-General Jan Willem Janssens, but shortly after his arrival British forces occupied several Dutch East Indies ports including Java, and Thomas Stamford Raffles became Lieutenant Governor. Following Napoleon's defeat at the 1815 Battle of Waterloo and the Congress of Vienna, independent Dutch control was restored in 1816. Under the 1824 Anglo-Dutch Treaty, the Dutch secured British settlements such as Bengkulu in Sumatra, in exchange for ceding control of their possessions in the Malay Peninsula (Malaya) and Dutch India. The resulting borders between former British and Dutch possessions remain today between modern Malaysia