Third Islamic caliphate
The Abbasid Caliphate or Abbasid Empire (; ) was the third caliphate to succeed the Islamic prophet Muhammad. It was founded by a dynasty descended from Muhammad's uncle, Abbas ibn Abd al-Muttalib (566–653 CE), from whom the dynasty takes its name. They ruled as caliphs for most of the caliphate from their capital in Baghdad in modern-day Iraq, after having overthrown the Umayyad Caliphate in the Abbasid Revolution of 750 CE (132 AH). The Abbasid Revolution had its origins and first successes in the easterly region of Khorasan, far from the Levantine center of Umayyad influence. 
The Abbasid Caliphate first centered its government in Kufa, modern-day Iraq, but in 762 the caliph al-Mansur founded the city of Baghdad, near the ancient Babylonian capital city of Babylon and Sassanid city of Ctesiphon. Baghdad became the center of science, culture, and invention in what became known as the Golden Age of Islam. It was also during this period that Islamic manuscript production reached its height. Between the 8th and 10th centuries, Abbasid artisans pioneered and perfected manuscript techniques that became standards of the practice. This, in addition to housing several key academic institutions, including the House of Wisdom, as well as a multiethnic and multi-religious environment, garnered it an international reputation as a centre of learning. The Abbasid period was marked by the use of bureaucrats (such as the Barmakid family) for governing the territories as well as an increasing inclusion of non-Arab Muslims in the "ummah" (Muslim community). Despite this initial cooperation, the Abbasids of the late 8th century had alienated both non-Arab "mawali" (clients).
The political power of the caliphs was limited with the rise of the Iranian Buyids and the Seljuq Turks, who captured Baghdad in 945 and 1055, respectively. Although Abbasid leadership over the vast Islamic empire was gradually reduced to a ceremonial religious function in much of the caliphate, the dynasty retained control of its Mesopotamian domain during the rule of Caliph al-Muqtafi and extended into Iran during the reign of Caliph al-Nasir. The Abbasids' age of cultural revival and fruition ended in 1258 with the siege of Baghdad by the Mongols under Hulagu Khan and the execution of al-Musta'sim. The Abbasid line of rulers re-centred themselves in the Mamluk capital of Cairo in 1261. Though lacking in political power, with the brief exception of Caliph al-Musta'in, the dynasty continued to claim religious authority until a few years after the Ottoman conquest of Egypt in 1517, with the last Abbasid caliph being al-Mutawakkil III.
History.
The Abbasid caliphs were 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 Muhammad in replacing the Umayyad descendants of Banu Umayya by virtue of their closer bloodline to Muhammad.
Abbasid Revolution (750–751).
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 in Persia for the return of power to the family of Muhammad, the Hashemites, during the reign of Umar II.
During the reign of Marwan II, this opposition culminated in the rebellion of Ibrahim al-Imam, the fourth in descent from Abbas. Supported by the province of Khorasan (Eastern Persia), even though the governor opposed them, and the Shia 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 Nahavand and finally in the Battle of Karbala, all in the year 748.
Ibrahim was captured by Marwan and was killed. The quarrel was taken up by Ibrahim's brother Abdallah, known by the name of Abu al-'Abbas as-Saffah, who defeated the Umayyads in 750 in the battle near the Great Zab and was subsequently proclaimed caliph. After this loss, Marwan fled to Egypt, where he was subsequently killed. The remainder of his family, barring one male, were also eliminated.
Rise to power (752–775).
Immediately after their victory, al-Saffah sent his forces to Central Asia, where his forces fought against Tang expansion during the Battle of Talas. Al-Saffah focused on putting down numerous rebellions in Syria and Mesopotamia. The Byzantines conducted raids during these early distractions. 
One of the first major changes effected by Abbasid rule was the move of the caliphate's center of power from Syria to Mesopotamia (present-day Iraq). This was closer to the Persian "mawali" support base of the Abbasids and the move addressed their demand for reduced Arab dominance in the empire. However, no definitive capital was yet selected. In these early Abbasid years, Kufa generally served as the administrative capital, but the caliphs were wary of the Alid sympathies in the city and did not always reside here. In 752, al-Saffah built a new city called al-Hashimiyya, at an uncertain location, most likely near Kufa. Later that same year, he moved to Anbar, where he built a new settlement for his Khurasani soldiers and a palace for himself.
It was al-Saffah's successor, Abu Ja'far al-Mansur (r. 754 – 775) who firmly consolidated Abbasid rule and faced down internal challenges. His uncle, Abdallah ibn Ali, the victor over the Umayyads at the Battle of the Zab, was the most serious potential rival for leadership and al-Mansur sent Abu Muslim, the Khurasani revolutionary commander, against him in 754. After Abu Muslim successfully defeated him, al-Mansur then turned to eliminate Abu Muslim himself. He arranged to have him arrested and executed in 755. 
On the western frontier, the Abbasids were unable to re-assert caliphal control over the western and central Maghreb, which the Umayyads had lost in the 740s. One member of the Umayyad dynasty, Abd ar-Rahman, also managed to escape the purge of his family and managed to establish independent in rule in al-Andalus (present-day Spain and Portugal) in 756, founding the Umayyad Emirate of Córdoba.
In 756, al-Mansur had also sent over 4,000 Arab mercenaries to assist the Chinese Tang dynasty in the An Lushan Rebellion against An Lushan. The Abbasids, or "Black Flags" as they were commonly called, were known in Tang dynasty chronicles as the "hēiyī Dàshí", "The Black-robed Tazi" () ("Tazi" being a borrowing from Persian "Tāzī", the word for "Arab"). Al-Rashid sent embassies to the Chinese Tang dynasty and established good relations with them. After the war, these embassies remained in China with Caliph Harun al-Rashid establishing an alliance with China. Several embassies from the Abbasid Caliphs to the Chinese court have been recorded in the "Old Book of Tang", the most important being those of al-Saffah, al-Mansur, and Harun al-Rashid.
In 762, al-Mansur suppressed a rebellion in the Hejaz led by al-Nafs al-Zakiyya, a descendant from Ali ibn Abi Talib, whose challenge to the Abbasid claim to leadership was based on his Alid lineage and thus presented a serious political threat. He was defeated by an Abbasid army led by Isa ibn Musa. It was after this victory, in 762, that al-Mansur finally established a proper Abbasid capital, Baghdad – officially called "Madinat al-Salam" ('City of Peace') – located on the Tigris River. Prior to this, he had continued to consider multiple sites for a capital, including al-Hashimiyya, which he used as a capital for a while, and al-Rumiyya (near the ruins of Ctesiphon), which he used for a few months. Various other sites in the region also appear to have served as "capitals" under either al-Saffah or al-Mansur prior to the founding of Baghdad.
Al-Mansur centralised the judicial administration, and later, Harun al-Rashid established the institution of Chief Qadi to oversee it. The Umayyad empire was mostly Arab; however, the Abbasids progressively became made up of more and more converted Muslims in which the Arabs were only one of many ethnicities. The Abbasids had depended heavily on the support of Persians in their overthrow of the Umayyads. Al-Mansur welcomed non-Arab Muslims to his court. While this helped integrate Arab and Persian cultures, it alienated many of their Arab supporters, particularly the Khorasanian Arabs who had supported them in their battles against the Umayyads.
Abbasid Golden Age (775–861).
The Abbasid leadership had to work hard in the last half of the 8th century (750–800) under several competent caliphs and their viziers to usher in the administrative changes needed to keep order of the political challenges created by the far-flung nature of the empire, and the limited communication across it. It was also during this early period of the dynasty, in particular during the governance of Al-Mansur, Harun al-Rashid, and al-Ma'mun, that its reputation and power were created. 
The position of "wazir" (vizier) developed in this period. It was initially akin to a secretary, but under the tenure of the Barmakids, an Iranian family close to the Abbasids, the position became powerful and Harun al-Rashid delegated state affairs to them for many years. This resulted in a more ceremonial role for many Abbasid caliphs relative to their time under the Umayyads; the viziers began to exert greater influence, and the role of the Caliph's aristocracy was slowly replaced by a Baramkid bureaucracy. To the west, Harun al-Rashid agreed to grant the province of Ifriqiya (centered in present-day Tunisia) as a hereditary emirate to Ibrahim ibn al-Aghlab, who founded the Aghlabid dynasty there.
Al-Mahdi restarted the fighting with the Byzantines, and his sons continued the conflict until Empress Irene pushed for peace. After several years of peace, Nikephoros I broke the treaty, then fended off multiple incursions during the first decade of the 9th century. These attacks pushed into the Taurus Mountains, culminating with a victory at the Battle of Krasos and the massive invasion of 806, led by Rashid himself.
Rashid's navy also proved successful, taking Cyprus. Rashid decided to focus on the rebellion of Rafi ibn al-Layth in Khorasan and died while there. Military operations by the caliphate were minimal while the Byzantine Empire was fighting Abbasid rule in Syria and Anatolia, with focus shifting primarily to internal matters; Abbasid governors exerted greater autonomy and, using this increasing power, began to make their positions hereditary.
While Baghdad remained the official capital, Harun al-Rashid chose to reside in Raqqa from 796 until the end of his reign. In 803, for reasons that remain unclear, Harun al-Rashid turned on and imprisoned or killed most of the Barmakids, who had wielded administrative power on his behalf. During the same period, several factions began either to leave the empire for other lands or to take control of distant parts of the empire. Still, the reigns of al-Rashid and his sons were considered to be the apex of the Abbasids. 
Domestically, Harun pursued policies similar to those of his father Al-Mahdi. He released many of the Umayyads and 'Alids his brother Al-Hadi had imprisoned and declared amnesty for all political groups of the Quraysh. Large scale hostilities broke out with Byzantium, and under his rule, the Abbasid Empire reached its peak. However, Harun's decision to split the succession proved to be damaging to the longevity of the empire.
After Rashid's death, the empire was split by a civil war between the caliph al-Amin and his brother al-Ma'mun, who had the support of Khorasan. This war ended with a two-year siege of Baghdad and the eventual death of Al-Amin in 813. Al-Ma'mun ruled for 20 years of relative calm interspersed with a rebellion in Azerbaijan by the Khurramites, which was supported by the Byzantines. Al-Ma'mun was also responsible for the creation of an autonomous Khorasan, and the continued repulsing of Byzantine forays.
In the 9th century, the Abbasids created an army loyal only to their caliphate, composed of non-Arab origin people, known as Mamluks. This force, created by al-Ma'mun and his brother and successor al-Mu'tasim (833–842), prevented the