The conquest of the Filipinos by Spain did not begin in earnest until 1564, when another expedition from New Spain, commanded by Miguel López de Legaspi, arrived. Spanish leadership was soon established over many small independent communities that previously had known no central rule. By 1571, when López de Legaspi established the Spanish city of Manila on the site of a Moro town he had conquered the year before, the Spanish foothold in the Philippines was secure, despite the opposition of the Portuguese, who were eager to maintain their monopoly on the trade of East Asia.
Manila repulsed the attack of the Chinese pirate Limahong in 1574. For centuries before the Spanish arrived the Chinese had traded with the Filipinos, but evidently none had settled permanently in the islands until after the conquest. Chinese trade and labor were of great importance in the early development of the Spanish colony, but the Chinese came to be feared and hated because of their increasing numbers, and in 1603 the Spanish murdered thousands of them (later, there were lesser massacres of the Chinese).
The Spanish governor, made a viceroy in 1589, ruled with the advice of the powerful royal audiencia. There were frequent uprisings by the Filipinos, who resented the encomienda system. By the end of the 16th cent. Manila had become a leading commercial center of East Asia, carrying on a flourishing trade with China, India, and the East Indies. The Philippines supplied some wealth (including gold) to Spain, and the richly laden galleons plying between the islands and New Spain were often attacked by English freebooters. There was also trouble from other quarters, and the period from 1600 to 1663 was marked by continual wars with the Dutch, who were laying the foundations of their rich empire in the East Indies, and with Moro pirates. One of the most difficult problems the Spanish faced was the subjugation of the Moros. Intermittent campaigns were conducted against them but without conclusive results until the middle of the 19th cent. As the power of the Spanish Empire waned, the Jesuit orders became more influential in the Philippines and acquired great amounts of property.