# List of caliphal governors of Medina

In early Islamic history, the governor of Medina (Arabic: عامل المدينة, romanized: ʿāmil al-Madīnah) was an official who administered the city of Medina and its surrounding territories.
During the era of the Rashidun, Umayyad and early Abbasid caliphates, the governor was generally appointed by the caliph, and remained in office until he died or was dismissed. The governorship was one of the chief administrative positions in the Hijaz and carried with it certain symbolic privileges, including the opportunity to lead the annual Muslim pilgrimage.

## Rashidun governors

Known in pre-Islamic times as Yathrib, Medina (Arabic: المدينة, meaning simply "The City") became the residence of the Islamic prophet Muhammad following his Hijrah from Mecca in 622 AD. Under Muhammad and the first three Rashidun caliphs, Medina acted as the capital of a rapidly increasing Muslim Empire, but its remoteness from the emerging power centers of Syria and Iraq eventually undermined its political importance. Following the assassination of the third caliph Uthman ibn Affan in July 656 and the outbreak of the First Fitna or civil war, his successor Ali ibn Abi Talib was compelled to depart from Medina in order to assert his authority in Iraq, and the city lost its status as the capital of the Islamic state.
With the departure of Ali from Medina, administration of the city was delegated to a number of representatives appointed by him. These representatives remained in control of Medina until 660, when an army dispatched by the Umayyad Mu'awiya ibn Abi Sufyan arrived at the city and forced Ali's governor to flee to Iraq.
| Name | Years | Nature of Termination | Notes |
| Sahl ibn Hunaif | From 657 | Dismissed | Governor for Ali |
| Tamman ibn Abbas | | Dismissed | Governor for Ali |
| Abu Ayyub al-Ansari | To 660 | Fled | Governor for Ali |

## Umayyad governors

Following the ascendency of the Umayyads in 661, Medina's loss of its political significance became permanent. The Umayyad caliphs, who were firmly based in the region of Syria, had few incentives to relocate to the Hijaz, and they generally made their residence in the area of Damascus. Although Medina continued to retain its religious importance as one of the Holy Cities of Islam, it became something of a political backwater under the Umayyads and its old elites, the Ansar, were reduced to acting as a "pious opposition" to the new regime.
As the Umayyads had no interest in returning the capital to Medina, they instead dispatched governors to administer the city on their behalf. Governors were normally selected by the caliph and remained in office until they died or were dismissed in favor of a replacement candidate. In addition to Medina itself, they were sometimes (though not always) given jurisdiction over Mecca and al-Ta'if, and were often selected by the caliphs to act as leader of the annual pilgrimage to Mecca. In an effort to ensure that Umayyad interests were fully represented in the city, the caliphs usually selected blood or marital relatives for the position, but a few governors, such as with the Ansari Abu Bakr ibn Muhammad ibn Amr ibn Hazm, were exceptions to this rule.
Governors assigned to Medina during this period played no role in the Muslim conquests due to the lack of active military fronts near the Hijaz, but they were occasionally forced to deal with internal challenges to Umayyad rule. During the Second Fitna the Medinese threw off their allegiance to Yazid ibn Mu'awiya (r. 680–683) and expelled all of the Umayyads then in the city; this attempt to regain their old power, however, came to an end with their defeat at the Battle of al-Harrah in August 683, and the city was pillaged by the victorious Syrian troops in retaliation for its disobedience. Shortly afterwards Medina came under the nominal control of the anti-caliph Abdallah ibn al-Zubayr (r. 683–692), but the Umayyads took back the city near the end of the Fitna and their hold on it was thereafter generally secure until the last years of their rule.
Umayyad control of Medina came to an end during the period of the Third Fitna; the city was lost temporarily to Ibadi rebels in 747, and was then lost permanently with the overthrow of the dynasty by the Abbasid Revolution in 750.
Umayyad governors :
| Name | Years | Nature of Termination | Notes |
| Marwan ibn al-Hakam | 662–669 | Dismissed | Subsequently became caliph in 684. Appointed by the caliph Mu'awiya ibn Abi Sufyan |
| Sa'id ibn al-As | 669–674 | Dismissed | Cousin of Mu'awiya, who appointed him |
| Marwan ibn al-Hakam | 674–677/8 | Dismissed | Re-appointed by Mu'awiya |
| Al-Walid ibn Utba ibn Abi Sufyan | 677/8–680 | Dismissed | Nephew of Mu'awiya, who appointed him |
| Amr ibn Sa'id ibn al-As | 680–681 | Dismissed | Son of Sa'id ibn al-As. Appointed by the caliph Yazid ibn Mu'awiya |
| Al-Walid ibn Utba ibn Abi Sufyan | 681–682 | Dismissed | Re-appointed, this time by Yazid ibn Mu'awiya |
| Uthman ibn Muhammad ibn Abi Sufyan | 682–683 | Expelled | Cousin of Yazid ibn Mu'awiya, who appointed him |
| None | 683 | n/a | Revolt of the Ansar, Qurayshis and non-Qurayshi Muhajirun in Medina |
Zubayrid interregnum :
| Name | Years | Nature of Termination | Notes |
| Ubayda ibn al-Zubayr | 684-685 | Dismissed | Brother of Abdallah ibn al-Zubayr, who appointed him. Jabir ibn al-Aswad ibn Awf and Abbas ibn Sahl ibn Sa'd al-Ansari are also mentioned as governors during this period |
| Mus'ab ibn al-Zubayr | 685-686 | Moved to Iraq | Brother of Ibn al-Zubayr, who appointed him |
| Jabir ibn al-Aswad ibn Awf | 687-690 | Dismissed | (Re-)Appointed by Ibn al-Zubayr |
| Talha ibn Abdallah ibn Awf | 690-691 | Fled | Appointed by Ibn al-Zubayr |
Umayyad governors (restored) :
| Name | Years | Nature of Termination | Notes |
| Tariq ibn Amr | 691/2-693 | Dismissed | Re-established Umayyad control over Medina; confirmed as governor by the caliph Abd al-Malik ibn Marwan |
| al-Hajjaj ibn Yusuf | 693-694 | Dismissed | Appointed by Abd al-Malik ibn Marwan |
| Yahya ibn al-Hakam ibn Abi al-As | 694-695 | Resigned | Uncle of Abd al-Malik ibn Marwan, who appointed him |
| Aban ibn Uthman | 695-702 | Dismissed | Son of Uthman ibn Affan. Appointed by Abd al-Malik ibn Marwan |
| Hisham ibn Isma'il al-Makhzumi | 702-706 | Dismissed | Father-in-law of Abd al-Malik ibn Marwan, who appointed him |
| Umar ibn Abd al-Aziz | 706-712 | Dismissed | Subsequently became caliph in 717. Appointed by the caliph al-Walid ibn Abd al-Malik |
| Uthman ibn Hayyan al-Murri | 712-715 | Dismissed | Appointed by al-Walid ibn Abd al-Malik |
| Abu Bakr ibn Muhammad ibn Amr ibn Hazm | 715-720 | Dismissed | Appointed by the caliph Sulayman ibn Abd al-Malik |
| Abd al-Rahman ibn al-Dahhak ibn Qays al-Fihri | 720-723 | Dismissed | Appointed by the caliph Yazid ibn Abd al-Malik |
| Abd al-Wahid ibn Abdallah al-Nasri | 723-724 | Dismissed | Appointed by Yazid ibn Abd al-Malik |
| Ibrahim ibn Hisham ibn Isma'il al-Makhzumi | 724-732 | Dismissed | Son of Hisham ibn Isma'il. Appointed by the caliph Hisham ibn Abd al-Malik |
| Khalid ibn Abd al-Malik ibn al-Harith ibn al-Hakam | 732-736/7 | Dismissed | Appointed by Hisham ibn Abd al-Malik |
| Muhammad ibn Hisham ibn Isma'il al-Makhzumi | 736/7-743 | Dismissed | Brother of Ibrahim ibn Hisham. Appointed by Hisham ibn Abd al-Malik |
| Yusuf ibn Muhammad ibn Yusuf al-Thaqafi | 743-744 | Dismissed | Appointed by the caliph al-Walid ibn Yazid |
| Abd al-Aziz ibn Abdallah ibn Amr ibn Uthman | 744 | Dismissed | Great-grandson of Uthman ibn Affan. Appointed by the caliph Yazid ibn al-Walid |
| Abd al-Aziz ibn Umar ibn Abd al-Aziz | 744-747 | Dismissed | Appointed by Yazid ibn al-Walid |
| Abd al-Wahid ibn Sulayman ibn Abd al-Malik | 747 | Fled | Appointed by the caliph Marwan ibn Muhammad |
| None | 747-748 | n/a | Ibadi occupation of Medina |
| Muhammad ibn Abd al-Malik ibn Marwan | 748 | | |
| Al-Walid ibn Urwah al-Sa'di | 748-750 | Dismissed | Appointed by his uncle Abd al-Malik ibn Muhammad ibn Atiyyah |
| Yusuf ibn Urwah al-Sa'di | 750 | | Last governor for the Umayyads. Appointed by Marwan ibn Muhammad |

## Abbasid governors

The administrative situation of Medina was initially little changed by the coming of the Abbasids, who were generally centered in the region of Iraq. Governors of Medina continued to be appointed by the caliph and were selected to lead several of the annual pilgrimages. Like their predecessors, the Abbasid caliphs frequently chose members of their own dynasty for the governorship, but they also often appointed individuals from other families who were related to the Abbasids in some capacity.
In the first decades of Abbasid rule Medina was occasionally the scene of Alid rebel movements, but these were generally minor affairs and were easily put down by the government. The short-lived revolt of Muhammad al-Nafs al-Zakiyya in 762, which was briskly defeated despite having had strong support from among the Medinese elite, particularly served as a demonstration as to how far the city had declined in terms of actual political influence, and Muhammad's choice to base the rebellion in Medina was specifically criticized by Muslim historians for prioritizing the city's religious significance over any sound strategic considerations. A later revolt by Muhammad's nephew al-Husayn ibn Ali al-Abid was also brief and ended in failure at the Battle of Fakhkh near Mecca in 786, while the seizure of Medina by a lieutenant of the pro-Alid rebel Abu al-Saraya al-Sari ibn Mansur in 815 during the Fourth Fitna was likewise temporary and the city was soon restored to Abbasid control.
Two major sources for the identities of governors of Medina, the annalists Muhammad ibn Jarir al-Tabari and Khalifah ibn Khayyat, give regular updates down to the mid-780s, but provide only sporadic information after that time. The cessation of coverage, as well as available numismatic evidence, indicate that Medina may have been declining in importance during this period, and that it was gradually being superseded by Mecca as the primary administrative center of the Hijaz. In the ninth and tenth centuries the Hijaz was also affected by a general economic downturn and Medina began to be threatened by brigand raids, of which at least one was serious enough to prompt the central government to send an expedition to restore order.
With the collapse of the Abbasids' political power in the early tenth century, the Ikhshidid ruler of Egypt Muhammad ibn Tughj al-Ikhshid was granted jurisdiction over Mecca and Medina by the caliph al-Radi in 935. Later that century, the descendants of Husayn ibn Ali gained local control of Medina, and they thereafter ruled the Emirate of Medina under Egyptian suzerainty down nearly to the Ottoman conquest in 1517.
| Name | Years | Nature of Termination | Notes |
| Dawud ibn Ali | 750 | Died in office | Uncle of the caliph al-Saffah, who appointed him |
| Ziyad ibn Ubaydallah ibn Abdallah ibn Abd al-Madan al-Harithi | 750-758 | Dismissed | Uncle of al-Saffah, who appointed him |
| Muhammad ibn Khalid ibn Abd Allah al-Qasri | 758-760/1 | Dismissed | Appointed by the caliph al-Mansur |
| Riyah ibn Uthman al-Murri | 760/1-762 | Imprisoned | Son of Uthman ibn Hayyan. Appointed by al-Mansur |
| None | 762 | n/a | Alid occupation of Medina |
| Kathir ibn al-Husayn al-Abdi | 762-763 | Dismissed | Appointed by Isa ibn Musa |
| Abdallah ibn al-Rabi al-Harithi | 763 | Dismissed | Appointed by al-Mansur |
| Ja'far ibn Sulayman ibn Ali | 763-766/7 | Dismissed | First cousin of al-Mansur, who appointed him |
| al-Hasan ibn Zayd ibn al-Hasan ibn Ali ibn Abi Talib | 766/7-772 | Dismissed | Appointed by al-Mansur |
| Abd al-Samad ibn Ali | 772-776 | Dismissed | Uncle of al-Mansur, who appointed him |
| Muhammad ibn Abdallah al-Kathiri | 776 | Dismissed | Appointed by the caliph al-Mahdi |
| Ubaydallah ibn Muhammad ibn Abd al-Rahman ibn Safwan al-Jumahi | 776-777 | Died in office | Appointed by al-Mahdi |
| Muhammad ibn Abdallah al-Kathiri | 777 | Dismissed | Re-appointed by al-Mahdi |
| Zufar ibn Asim al-Hilali | 777-780 | Dismissed | Appointed by al-Mahdi |
| Ja'far ibn Sulayman ibn Ali | 780-783 | Dismissed | Re-appointed, this time by al-Mahdi |
| Ibrahim ibn Yahya ibn Muhammad | 783-784 | Died in office | First cousin of al-Mahdi, who appointed him |
| Ishaq ibn Isa ibn Ali | 784-785 | Resigned | First cousin once removed of al-Mahdi, who appointed him |
| Umar ibn Abd al-Aziz ibn Abdallah ibn Abdallah ibn Umar ibn al-Khattab | 785-786 | Dismissed | Appointed by the caliph al-Hadi |
| Ishaq ibn Sulayman ibn Ali | From 786 | | First cousin twice removed of the caliph Harun al-Rashid, who appointed him |
| Abd al-Malik ibn Salih ibn Ali | | | First cousin twice removed of Harun al-Rashid, who appointed him |
| Muhammad ibn Abdallah al-Raba'i | From 789 | | Appointed by Harun al-Rashid |
| Musa ibn Isa ibn Musa | | | Second cousin of Harun al-Rashid, who appointed him |
| Ibrahim ibn Muhammad ibn Ibrahim | | | Appointed by Harun al-Rashid |
| Ali ibn Isa ibn Musa | | | Second cousin of Harun al-Rashid, who appointed him |
| Muhammad ibn Ibrahim | | | Appointed by Harun al-Rashid |
| Abdallah ibn Mus'ab al-Zubayri | 796/7 | | Appointed by Harun al-Rashid |
| Bakkar ibn Abdallah al-Zubayri | 797 | 808/9 | Appointed by Harun al-Rashid |
| Abu al-Bakhtari Wahb ibn Wahb | 808-809 | | Appointed by Harun al-Rashid |
| Isma'il ibn al-Abbas ibn Muhammad | 810 | | Appointed by the caliph al-Amin |
| Dawud ibn Isa ibn Musa al-Hashimi | 811-815 | Fled | Second cousin once removed of al-Amin, who appointed him. Later switched his allegiance to the rival caliph al-Ma'mun |
| None | 815 | n/a | Occupation of Medina on behalf of the pro-Alid rebel Abu al-Saraya al-Sari ibn Mansur |
| Harun ibn al-Musayyab | From 815 | | Dispatched by the general Ali b. Abi Sa'id |
| Ubaydallah ibn al-Abbas ibn Ubaydallah ibn al-Abbas | | | Appointed by al-Ma'mun |
| Ubaydallah ibn al-Hasan ibn Ubaydallah ibn al-Abbas ibn Ali ibn Abi Talib | From 820 | | Appointed by al-Ma'mun |
| Quthm ibn Ja'far ibn Sulayman ibn Ali ibn Abdallah ibn al-Abbas | From 823 | Dismissed | Appointed by al-Ma'mun |
| Muhammad ibn Fulan ibn al-Husayn ibn Zayd | | Dismissed | Appointed by al-Ma'mun |
| Sulayman ibn Abdallah ibn Sulayman ibn Ali | From 828 | | Appointed by al-Ma'mun |
| Muhammad ibn Salih ibn al-Abbas | From 843 | | Appointed by the caliph al-Wathiq |
| Salih ibn Ali ibn Isa | To 861 | | |
| Ali ibn al-Husayn ibn Isma'il | From 861 | | |
| Ishaq ibn Muhammad ibn Yusuf al-Ja'fari | To 879 | Died in office | |
| Musa ibn Muhammad ibn Yusuf al-Ja'fari | 879 | Killed | Brother of Ishaq ibn Muhammad |
| Ahmad ibn Muhammad ibn Isma'il ibn al-Hasan ibn Zayd | 879 | Dismissed | Initially a Zaydi rebel; subsequently legitimized by the central government |
| Muhammad ibn Abi al-Saj | From 879 | Dismissed | |
| Al-Fadl ibn al-Abbas al-Abbasi | fl. 883 | | |
| Ahmad ibn Muhammad al-Ta'i | From 885 | | |
| Harun ibn Muhammad ibn Ishaq al-Hashimi | fl. 890 | | |