When the Portuguese started their colonial expansion by taking Ceuta in retribution for its piracy in 1415, Tangier was always a major goal. They failed to capture it in 1437, 1458, and 1464, but occupied it unopposed on 28 August 1471 after its garrison fled upon learning of the conquest of Asilah. As in Ceuta, they converted its chief mosque into the town's cathedral church; it was further embellished by several restorations during the town's occupation. In addition to the cathedral, the Portuguese raised European-style houses and Franciscan and Dominican chapels and monasteries. The Wattasids assaulted Tangier in 1508, 1511, and 1515 but without success. In the 17th century, it passed with the rest of Portugal's domains into Spanish control as part of the personal union of the crowns but maintained its Portuguese garrison and administration.