The third caliphate, the Abbāsid Caliphate was ruled by the Abbāsids, a dynasty of Meccan origin descended from Hāshim, a great-grandfather of Muhammad, via Abbās, an uncle of Muhammad. Caliph al-Mansur founded its second capital of Baghdād in 762, which became a major scientific, cultural and art centre, as did the territory as a whole, during the period known as the Islamic Golden Age. From the 10th century, Abbasid rule became confined to an area around Baghdad and saw several occupations from foreign powers. In 1258, the Mongol Empire sacked Baghdad, ending the Abbasid rule over Baghdad, but in 1261 the Mamluks in Egypt re-established the Abbasid Caliphate in Cairo. Though lacking in political power, the Abbasid dynasty continued to claim authority in religious matters until the Ottoman conquest of Mamluk Egypt in 1517, which saw the establishment of the Ottoman Caliphate.