The Abbasid Caliphate first centred its government in Kufa, modern-day Iraq, but in 762 the caliph Al-Mansur founded the city of Baghdad, near the Sasanian capital city of Ctesiphon. The Abbasid period was marked by reliance on Persian bureaucrats (notably the Barmakid family) for governing the territories conquered by Arab Muslims as well as an increasing inclusion of non-Arab Muslims in the ummah (national community). Persianate customs were broadly adopted by the ruling elite, and they started supporting artists and scholars. Baghdad became a centre of science, culture, philosophy and invention in what became known as the Golden Age of Islam.
Despite this initial cooperation, the Abbasids of the late 8th century had alienated both non-Arab mawali (clients) and Iranian bureaucrats. They were forced to cede authority over Al-Andalus and the Maghreb to the Umayyads in 756, Morocco to the Idrisid dynasty in 788, Ifriqiya to the Aghlabids in 800 and Egypt to the Shi'ite Caliphate of the Fatimids in 969. The political power of the caliphs largely ended with the rise of the Iranian Buyids and the Seljuq Turks, which each captured Baghdad in 945 and 1055 respectively. Although Abbasid leadership over the vast Islamic empire was gradually reduced to a ceremonial religious function, the dynasty retained control over its Mesopotamian domain.
The Abbasids' period of cultural fruition ended in 1258 with the sack of Baghdad by the Mongols under Hulagu Khan. The Abbasid line of rulers, and Muslim culture in general, re-centred themselves in the Mamluk capital of Cairo in 1261. Though lacking in political power, the dynasty continued to claim authority in religious matters until after the Ottoman conquest of Egypt in 1517.
The Abbasid caliphs were Arabs descended from Abbas ibn Abd al-Muttalib, one of the youngest uncles of Muhammad and of the same Banu Hashim clan. The Abbasids claimed to be the true successors of Prophet Muhammad in replacing the Umayyad descendants of Banu Umayya by virtue of their closer bloodline to Muhammad.
The Abbasids also distinguished themselves from the Umayyads by attacking their moral character and administration in general. According to Ira Lapidus, "The Abbasid revolt was supported largely by Arabs, mainly the aggrieved settlers of Merv with the addition of the Yemeni faction and their Mawali". The Abbasids also appealed to non-Arab Muslims, known as mawali, who remained outside the kinship-based society of the Arabs and were perceived as a lower class within the Umayyad empire. Muhammad ibn 'Ali, a great-grandson of Abbas, began to campaign for the return of power to the family of Prophet Muhammad, the Hashimites, in Persia during the reign of Umar II.
During the reign of Marwan II, this opposition culminated in the rebellion of Ibrahim the Imam, the fourth in descent from Abbas. Supported by the province of Khorasan, Persia, even though the governor opposed them, and the Shi'i Arabs, he achieved considerable success, but was captured in the year 747 and died, possibly assassinated, in prison.
On 9 June 747 (15 Ramadan AH 129), Abu Muslim, rising from Khorasan, successfully initiated an open revolt against Umayyad rule, which was carried out under the sign of the Black Standard. Close to 10,000 soldiers were under Abu Muslim's command when the hostilities officially began in Merv. General Qahtaba followed the fleeing governor Nasr ibn Sayyar west defeating the Umayyads at the Battle of Gorgan, the Battle of Nahāvand and finally in the Battle of Karbala, all in the year 748.