Internal dissensions eventually divided the loyalties of the kingdoms in al-Andalus of the 11th century; the collapse of the Caliphate of Córdoba in 1031 led to a period of smaller successor states (taifas), while the Kingdom of León lying directly to the north was ceded the county of Portugal. The history of the county is traditionally dated from the reconquest in 868 by Vímara Peres of the city of Portucale (Porto), which was the port of Cale, the present Gaia. Although the county had its seat at Guimarães, the economic strength that enabled its autonomy was based in Portucale. The isolated Atlantic province, recently centred in Coimbra, separated from the Kingdom of León to become the independent Kingdom of Portugal in 1139. It was eventually attached to Lisbon, thus integrating the territories adjoining the entire length of the Tagus.
Famed for its opulence, al-Us̲h̲būna’s capture would bring the kingdom great prestige. Afonso I and his Christian forces first attempted to conquer the city in 1137 but failed to breach the city walls. In 1140 crusaders passing through Portugal launched another unsuccessful attack. According to the Anglo-Norman chronicler, in June and July 1147, a more numerous force of crusaders, consisting of 164 boatloads of English, Norman, and Rhineland crusaders, left from Dartmouth in England bound for the Holy Land. Bad weather forced the ships to stop on the Portuguese coast at Porto where they were persuaded to join in a new assault on the city. While the Portuguese forces attacked by land, the crusaders, lured by promises of booty to be taken and prisoners to be ransomed, set up their siege engines, among them catapults and towers, and attacked both by sea and land, preventing the arrival of reinforcements from the south. In their first encounters the Muslims killed many Christians; this affected the Crusader’s morale, and occasioned several bloody conflicts between the various Christian contingents.
Legend has it that after many previous attempts, the Portuguese knight Martim Moniz led an attack on the castle doors and when he saw the Moors closing them, blocked the doorway with his own body, allowing his companions to enter, and was crushed. With the success of the crusaders’ assault on the city’s walls with siege engines, the Moors capitulated on 22 October. According to an account by the priest Raol addressed to Osbert of Bawdsley (Osbernus), Germans from Cologne and the Flemish cohort violated their oaths to the king of Portugal after entering the city and plundered it. These crusaders behaved in a wanton manner, looting Muslims and Mozarabs indiscriminately, debauching virgins and even cutting the throat of the elderly Mozarab bishop. Afterwards, an epidemic of the plague killed thousands among the Mozarabic and the Muslim populations.
Afonso I officially took possession of the city on 1 November, when the Great Mosque in the Moorish Aljama was dedicated to St. Mary in a religious ceremony converting it to a Cathedral. He appointed Gilberto of Hastings, an English crusader, the first Catholic bishop of the city, and granted lands and titles to many of the most prominent crusaders in the region.
After conquering the city, Afonso I received the news that the relics of Saint Vincent of Saragossa were buried in the Algarve. He made his way to the South, to reclaim the martyr’s body but, when he arrived there, the village had been totally destroyed and there was no sign of the site of the burial. It was then that a flock of crows was seen flying over a site where the body of the Saint was finally found. The body was taken by ship to Lisbon in 1176, and legend has it that two crows always accompanied the boat carrying the remains of Saint Vincent the Martyr . From this remarkable story, the crow was chosen as a symbol of Lisbon, as the guardian of the city.Although these birds became a symbol of the capital, they can no longer be found among the city’s species of bird.
Three years later, in 1150, Afonso I built a cathedral on the site of the Great Mosque, now the Sé. The original Christian edifice built on the site had been converted into a mosque by the Moors, but when Afonso took the city, the building was already decrepit. He had the structure rebuilt and enlarged under the name of the first cathedral of Lisbon, Santa María, and all the privileges of Mérida, the ancient ecclesiastical capital of the former Roman province of Lusitania, passed to the new diocese.