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.
East Indies theatre of the French Revolutionary Wars to Macau. After seeing his charges into harbour in December, Captain Edward Cooke investigated Manila himself in "Sybille", accompanied by "Fox". There he discovered the weak state of the Spanish squadron. Other British ships were operating in the East Indies: in July 1797, "Resistance" and a force of EIC troops captured Kupang on Timor but were subsequently driven off by an armed uprising by the Malay citizens of the town. In the street fighting 13 British troops and 300 Malays were killed. "Resistance" was subsequently lost on 24 July 1798, accidentally destroyed with more than 300 of its crew in