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.
Netherlands Indies gulden power in the East, but the unfamiliar coins were rejected in favour of the well-known 8 Real coins produced by Spain and its possessions, which were accepted all over the world. The Spanish coins remained the preferred large silver (trade) coin in the Indies until the 19th century. In 1602, the United East India Company (VOC) was formed from six trading companies in the Netherlands, and granted a trade monopoly over the Indies. In 1619 the Company established its capital at Jacatra, which it called Batavia. It gradually spread its influence over Java, and established control over Sumatra in 1667