# data[].attributes.body
The Portuguese navigator and explorer Ferdinand Magellan headed the first Spanish foray to the Philippines when he made landfall on Cebu in March 1521; a short time later he met an untimely death on the nearby island of Mactan. After King Philip II (for whom the islands are named) had dispatched three further expeditions that ended in disaster, he sent out Miguel López de Legazpi, who established the first permanent Spanish settlement, in Cebu, in 1565. The Spanish city of Manila was founded in 1571, and by the end of the 16th century most of the coastal and lowland areas from Luzon to northern Mindanao were under Spanish control. Friars marched with soldiers and soon accomplished the nominal conversion to Roman Catholicism of all the local people under Spanish administration. But the Muslims of Mindanao and Sulu, whom the Spanish called Moros, were never completely subdued by Spain.

Spanish rule for the first 100 years was exercised in most areas through a type of tax farming imported from the Americas and known as the encomienda. But abusive treatment of the local tribute payers and neglect of religious instruction by encomenderos (collectors of the tribute), as well as frequent withholding of revenues from the crown, caused the Spanish to abandon the system by the end of the 17th century. The governor-general, himself appointed by the king, began to appoint his own civil and military governors to rule directly.

# data[].attributes.body
On June 6, 1647, Dutch vessels were sighted near Mariveles Island. In spite of the preparations, the Spanish had only one galleon (the San Diego) and two galleys ready to engage the enemy. The Dutch had twelve major vessels.

On June 12, the armada attacked the Spanish port of Cavite. The battle lasted eight hours, and the Spanish believed they had done much damage to the enemy flagship and the other vessels. The Spanish ships were not badly damaged and casualties were low. However, nearly every roof in the Spanish settlement was damaged by cannon fire, which particularly concentrated on the cathedral. On June 19, the armada was split, with six ships sailing for the shipyard of Mindoro and the other six remaining in Manila Bay. The Dutch next attacked Pampanga, where they captured the fortified monastery, taking prisoners and executing almost 200 Filipino defenders. The governor ordered solemn funeral rites for the dead and payments to their widows and orphans.[61][62][63]

There was an expedition the following year that arrived in Jolo in July. The Dutch had formed an alliance with an anti-Spanish king, Salicala. The Spanish garrison on the island was small, but survived a Dutch bombardment. The Dutch finally withdrew, and the Spanish made peace with the Joloans, and then also withdrew.