D. Afonso Henriques and the Second Crusade took Lisbon from the Muslim hands in 1147. The very first bishop of this cathedral was an English crusader, Gilbert of Hastings. This cathedral is built over a medieval mosque, few of the remains have been found at the back of the cathedral.
At the end of the 13th century King Dinis of Portugal built a Gothic cloister and parts of the old mosque were levelled. Afonso IV of Portugal had the main chapel converted into a royal pantheon in Gothic style for him and his family.