Miguel Lopez de Legazpi’s expedition in 1564 had secured the Philippine archipelago to Spain (see Exploration); and in 1571 a fortress was built in Manila, on the island of Luzon, which became the seat of the government. From there numerous partial expeditions then radiated to conquer the other islands, while the Portuguese fought, tending to assert their dominion contrary to the pacts of Tordesillas and the later agreements concerning the Moluccas. But the question of belonging to the Philippines was judged in a favorable sense to Spain, by a junta, of which he belonged with other cosmographers and with the senior pilot, Alonso of Santa Cruz, his father Urdaneta.
The possession was anything but peaceful: while the work of submission continued and, parallel to this, that of conversion of the natives to Catholicism, the government of the archipelago had to endure bitter fights with the Chinese pirates and the Japanese, whose armies navals repeatedly threatened Manila (1574, 1578, 1584). The work of colonization also proceeded, contracts (asientos) having been stipulated several times for the transport from Mexico of men fit for arms with their respective families, who were awarded encomiendas under the same conditions with which they were assigned in the lands of America; but the reports of the governors are full of complaints about the poor quality of these immigrants, mostly prison waste.
When Philip II joined his kingdom of Spain to that of Portugal, the government of the Philippines was responsible several times to defend the Moluccas and the other Portuguese possessions of the Sunda Sea from the yellow pirates, and even more from the Dutch. The attempts made in 1601-3 by the army of Hurtado de Mendoza to take some islands of the archipelago from the Dutch were successful: later (1606) Admiral Pedro Braso de Acuña won the Dutch at Ternate. A few years later Manila, blocked by Admiral Witter’s Dutch, was freed thanks to the daring of Juan de Silva, who defeated the enemy with lesser forces (1609). In 1617, Captain Juan Ronquillo del Castillo won a powerful Dutch naval army under Admiral Spielbergen in Playahonda. But the Dutch did not take long to join the English, no less greedy and tenacious than the former; and the cost of maintaining the armies, in a territory so far from Spain, and moreover with the obligation, in order to avoid the Indian Ocean in full domination by the enemies, to supply them by the Pacific route, was such that, as is according to a report dated 1621, the new king Philip IV was tempted to abandon that archipelago and was held back only by the thought that the well-started work of Christianization would be lost.
Fortunately for Spain, the massacre of the English colonists of Amboina (1623) by the Dutch broke the agreements between the Netherlands and England and the governors of the Philippines had a little respite, who found it easy to persuade the natives to help the Spaniards in fight foreigners. The relief sent to the Portuguese of Macao, attacked by the Dutch, provoked a new attack on Manila, which was repulsed, and which in turn gave rise to the Spanish expedition to Formosa, where the Spaniards occupied a position, which they called Santiago (1626). Uprising of indigenous peoples and Chinese immigrants, rebellions on this or that island, naval clashes with the Dutch, the detachment of Portugal from Spain (1640) with the consequent loss, for Spain, of the naval bases of the Moluccas, and therefore with the greater frequency of the assaults and harassment of the Dutch, characterize the reign of Philip IV. The Peace of Westphalia came to give a respite to the Spaniards and the Philippines enjoyed relative tranquility, even when, under the reign of Charles II, the colonial war raged very violently with England: so much so that the governors were able to have the Carolines (so called in honor of the king). During the reign of Philip V of Bourbon and his successor, the Philippines were greatly harassed by pirates from the great Sunda islands, and especially from Borneo, who repeatedly desolated Luzon and the other parts of the Archipelago, forcing the governors to frequent expeditions., which did not always have a lucky outcome. After all, those pirates found refuge in the islands belonging to Holland:
In the second half of the century. XVIII the English, in their frequent wars with Spain, an ally of France by virtue of the family pact, also targeted the Philippines. In 1762, ignoring the declaration of war in Manila, a team that had departed from Madras under the orders of Admiral Samuel Cornish suddenly appeared in Cavite and, taking advantage of the surprise, occupied some strong positions and ordered Archbishop Rojo, pro-governor, to surrender. The defense attempts were rejected: the artillery bombed the weak and scarce fortification works. It was necessary to capitulate to very serious conditions, which did not spare the looting (October 5, 1762). The capitulation, however, was not generally recognized; Simón de Anda y Salazar proclaimed himself governor, and established the seat of government in Bacolor, for 15 months he kept the English locked up in Manila. The peace of Paris returned to the Spaniards Manila with the other lands, thanks to the mediation of Frederick II: but the fortifications and the arsenal of Cavite were destroyed. A few years later Spain began relations with the Philippines across the Indian Ocean, thus detaching this archipelago from Mexico, on which it had in a certain way until then depended.
During the French Revolution and the subsequent occupation of Spain by Napoleon, the Philippines remained loyal to King Ferdinand. But the enactment of the constitution of 1812 produced a great stir in the residents of color. They claimed to be considered equal to the Spaniards; hence riots and mutinies, which did not cease even after the return of King Ferdinand to the throne. The revolution of the colonies of America increased: the abolition of the privileges of the Company that had monopolized the trade, the expulsion of many American Creoles who had settled on the island and other measures failed to mitigate the discontent. In July 1823 a military pronouncement occurred which was soon suppressed: but the evil was not eradicated and spread, while, made more and more daring by the weakness of the government, the pirates infested the archipelago, occupied (1823) some islands, from which they were driven out by an expedition in the following year. In 1854 the colonial domination soon collapsed due to the rebellion of a mestizo, José Cuesta, who was however vigorously repressed by the governor Marquis de Novaliches.
But the separatist ferments, favored by the work of United States agents, became more and more diffused. The secret society called Katipunan arose, who gathered around him a large part of the Tagala natives and many mestizos. Under the governorship of Ramón Blanco a separatist movement was openly manifested, which the ferocious repression was unable to tame: the doctor José P. Rizal y Alonso, who placed himself at the head of the movement, was shot (1896); but to avenge him a new leader arose, Emilio Aguinaldo, who forced the governor Fernando Primo de Rivera to come to negotiations, and to make numerous concessions, which however were not kept (Biacnabató pact). Therefore, when the Spanish-American war broke out and the weak, old Spanish navy was destroyed in Cavite, Aguinaldo, in agreement with the commander of the United States naval forces, returned to the archipelago and proclaimed the independence of the Philippines (June 12, 1898), establishing the capital in Malolos. With the Peace of Paris (December 10, 1898) Spain had to give up the archipelago in favor of the United States; the ephemeral independence of the Philippines was destroyed. Aguinaldo attempted guerrilla warfare against the North Americans, and began it on February 4, 1899, but was taken prisoner (March 23, 1901).
The government of the United States granted concessions to the new subjects, in a democratic and autonomist sense; but only in 1907 could the legislative assembly be opened. In 1916, the Philippines was granted a very wide autonomy and a constitution (completed on 30 August 1928) and the intention was declared to give them independence, as soon as it was possible to establish a solid and stable government.