The Battle of Fakhkh () was fought on 11 June 786 between the forces of the Abbasid Caliphate and the supporters of a pro-Alid rebellion in Mecca under al-Husayn ibn Ali, a descendant of Hasan ibn Ali.

Husayn and his supporters planned an uprising at Medina during the annual Hajj pilgrimage of 786, but their hand was forced by a confrontation with the local governor, al-Umari. The conspirators rose in revolt on the morning of 16 May, and seized the Mosque of the Prophet, where Husayn's supporters swore allegiance to him. The revolt failed to gather support among the populace, and the reaction of the Abbasid garrison prevented the rebels from establishing control over the city, and eventually confined them to the Mosque itself. After eleven days, the Alids and their supporters, some 300 strong, abandoned Medina and headed to Mecca. 

Informed of these events, the Abbasid caliph al-Hadi appointed his uncle Muhammad ibn Sulayman ibn Ali to deal with the rebels, with an army composed chiefly of the armed retinues of the various Abbasid princes who on that year had gone to the pilgrimage. In the ensuing battle, at the wadi of  near Mecca, Husayn and over a hundred of his followers were killed, many others were captured, and some escaped by passing themselves off as pilgrims, including the future founder of the Idrisid dynasty in what is now Morocco. The uprising had a strong social character, with Husayn drawing inspiration from Zayd ibn Ali's 740 revolt, and itself impacted later Zaydi Shi'a practices.

Background
In 748–750, the Abbasid Revolution overthrew the Umayyad Caliphate (661–750) and established the Abbasid dynasty at the helm of the Islamic world. The change of dynasty was not a mere succession struggle, but the culmination of a broad social and political movement that rejected the Umayyad regime, which was widely regarded as oppressive, too dependent on and favouring its Syrian heartland to the exclusion of other areas, and more concerned with the worldly aspects of the caliphate than the teachings of Islam. A widespread belief at the time favoured replacing Umayyad dynastic rule with that of a "chosen one from the Family of Muhammad" (), who alone would have the divine guidance necessary to interpret the Quran and create a truly Islamic government that would bring justice to the Muslim community, treating all Muslims equally regardless of their origin. In the first instance this meant the Alids, i.e., those claiming descent from Muhammad via Ali ibn Abi Talib. However, the Abbasids exploited the vagueness of the  slogan by portraying themselves as also being members of the wider 'Family of the Prophet' through their common descent from the Banu Hashim clan. This claim was rejected by later Shi'a writers, who restricted membership in the Family of the Prophet to the Alids and thus considered the Abbasids as usurpers, but this distinction was not so clear-cut at the time, and the Abbasid claims appear to have been widely accepted when they came to power.

As a result, the relationship between the Abbasid dynasty and the Alids was ambivalent and underwent many changes. The Abbasids tried to secure Alid support, or at least acquiescence to their rule, through the award of salaries and honours at court. Nevertheless, many Alids, chiefly of the Zaydi and Hasanid branches, continued to reject the Abbasids as usurpers; several went into hiding and once again tried to rouse the discontented against the new regime. The second Abbasid caliph, al-Mansur (), imprisoned several Alids, and had to face a major Alid revolt in Medina and Basra, headed by Muhammad al-Nafs al-Zakiyya, in 762–763. A close relative of Muhammad al-Nafs al-Zakiyya was al-Husayn ibn Ali. His father, Ali al-Abid, was Muhammad's first cousin, and his mother Zaynab was Muhammad's sister. Ali al-Abid was famed for his piety, and volunteered to share the fate of his relatives, who were imprisoned by al-Mansur. He reportedly endured imprisonment steadfastly, but died in 763.

Husayn thus grew up in what the historian Laura Veccia Vaglieri describes as "an atmosphere of extreme piety and of secret hatred for the Abbasids". Nevertheless, Husayn had friendly relations with the third Abbasid caliph, al-Mahdi (), who gave him money and released an Alid prisoner at Husayn's intercession.

Outbreak of the revolt

Shortly after al-Mahdi died in July 785, Husayn and his followers rose in revolt at Medina, hoping to take advantage of the as yet unstable position of al-Mahdi's successor, al-Hadi. The 10th-century historian al-Tabari records several traditions that suggest that the immediate cause of the revolt was a quarrel between Husayn and the Abbasid governor of Medina, Umar ibn Abd al-Aziz ibn Abdallah, known as al-Umari. Al-Umari tried to regulate the Alids' movements in the city, and had three men, including Abu'l-Zift, a son of Muhammad al-Nafs al-Zakiyya, flogged and publicly humiliated for flouting the Islamic prohibition against the consumption of alcohol; this caused outrage among the Alids. The situation grew worse when it was discovered that Abu'l-Zift, for whom Husayn had vouched together with Yahya ibn Abdallah (a half-brother of Muhammad al-Nafs al-Zakiyya), had fled the city. In the ensuing confrontation with al-Umari, Yahya ibn Abdallah and the governor exchanged insults and threats, making the situation untenable for Husayn and his followers. While this may have been the immediate spark for the uprising, from the subsequent passages of al-Tabari it is evident that a revolt had been planned for some time. Preparations included the recruitment of Kufans who were secretly lying in wait in the city, and the hope of assistance by sympathizers who performed the Hajj pilgrimage. The motivation for the revolt is unclear; later Shi'a writers claim that it resulted from the anti-Alid stance of the new caliph, al-Hadi, but given the short interval since al-Hadi's accesstion, this is unlikely; however, Veccia Vaglieri suggests that there are indications that in his final years al-Mahdi himself had turned from a conciliatory policy to hostility towards the Alids, causing great discontent among the Shi'a. 

Having quarreled with the governor, the conspirators decided to move on the next morning (probably 16 May). About 26 Alids and some of their supporters gathered at the Mosque of the Prophet, where Husayn took the pulpit dressed in white and wearing a white turban. The rebels reportedly forced the muezzin to pronounce the call to the morning prayer in the Shi'a wording. Most people turned away when they saw Husayn in the pulpit, but his followers started arriving and swearing allegiance to him as caliph and imam and as , 'the One pleasing to God from the house of Muhammad'. The appellation  was evidently adopted as Husayn's regnal title in the fashion of the Abbasid caliphs. Whether out of the rivalry between the Hasanid and Husaynid branches, or because they thought that the uprising was doomed to failure, two of the Alids present refused their support. One of them, Musa ibn Ja'far al-Kadhim, who is considered as the seventh imam by the Twelver Shi'a, reportedly warned Husayn that his actions would only result in his death. 

In the meantime, Yahya ibn Abdallah went to arrest al-Umari at his residence, which adjoined the mosque. Alarmed by the Shi'a call to prayer, al-Umari had already gone into hiding. The assembled rebels were soon confronted by about 200 men from the local Abbasid garrison, with al-Umari and a certain Khalid al-Barbari, supervisor of the state domains at Medina, at their head. Khalid charged forward, aiming to kill Husayn, but was cut down by Yahya ibn Abdallah and his brother Idris; taking heart, the rebels attacked the Abbasid troops, who fled. With the Abbasid partisans repelled, Husayn addressed his followers, concluding his speech with a declaration and oath:

The revolt failed to find many adherents; according to al-Tabari, "the people of Medina locked their doors". Next morning, the fighting between the partisans of the Alids (, the 'wearers of white') and the Abbasids (, the 'wearers of black') spread throughout the city, with the Abbasids driving the Alids back. Fresh Abbasid troops under Mubarak al-Turki arrived next day, heartening the Abbasid partisans. After another day of fierce fighting, interrupted only during the hot noon hours, the Alids were confined to the area of the mosque, while the Abbasids used the nearby governor's residence as their base. The confrontation lasted for eleven days, during which the Alids, with their failure to secure the city evident, gathered supplies for travel. With about 300 followers, Husayn left the city on 28 May 786. In their wake, they left the mosque in a state of filth, defiled with the bones of the animals the beleaguered Alids had been eating, and its curtains cut up to make kaftans, leading to general indignation among the Medinese.

Confrontation at Fakhkh
With his 300 men, Husayn made for Mecca. On the way, he was joined by sympathizers from that city. In the meantime, al-Hadi assembled an armed response to Husayn's revolt. Several Abbasid princes were at that time returning from their pilgrimage to Mecca, which that year had been led by Sulayman ibn Abi Ja'far, a son of Caliph al-Mansur. One of the princes, Muhammad ibn Sulayman ibn Ali (first cousin of al-Mansur), had taken along a strong escort to protect his caravan from Bedouin attacks. Al-Hadi appointed Muhammad to deal with the rebels. Muhammad turned back to Mecca, where he was joined by the armed retinues of all of the Abbasid elites who had been in the city: the sources refer to 130 men mounted on horses and some mules, 200 on donkeys, and unspecified numbers of infantry. After a parade through the city that was probably designed to intimidate any pro-Alid sympathizers, the Abbasid army encamped at Dhu Tuwa at the edge of the city.

As the Alids and their supporters drew near, the two armies confronted one another on 11 June, at the wadi of , some  northwest of Mecca. The Abbasid force was led by the princes al-Abbas ibn Muhammad and Musa ibn Isa on the left, Muhammad ibn Sulayman on the right, and the Khurasani commander Mu'adh ibn Muslim in the centre. The battle began at dawn, and the Alid forces focused on the Abbasids' left wing. When Muhammad ibn Sulayman was victorious on his wing, he led the Abbasid right and centre against the bulk of the Alid army, which had been "massed together as if they were a compact ball of spun thread", in the words of al-Tabari, resulting in a rout of the Alids. During the battle, the Abbasids offered a pledge of clemency (), but Husayn refused it, fighting on until he was killed. His severed head was taken to al-Hadi, who sent it on to Khurasan as a warning to the local Shi'a. 

Over a hundred of Husayn's followers fell, and were left unburied at the battlefield for three days; but others availed themselves of the  to surrender. Abu'l-Zift was one of them, surrendering to his uncle, Muhammad ibn Sulayman; but he was killed by Ubayd Allah ibn al-Abbas at the urging of his father, al-Abbas ibn Muhammad, and Musa ibn Isa, leading to a fierce quarrel between the Abbasid princes. Of the Alids taken prisoner, a brother (Sulayman) and a son (al-Hasan) of Muhammad al-Nafs al-Zakiyya were executed at Mecca, while al-Hadi executed at least three other Alid prisoners at Baghdad. Al-Tabari and other medieval Muslim authors report stories about al-Hadi's sorrow and regret over the necessity of the death of "the Messenger of God's own offspring", but modern historians doubt their authenticity, especially as other sources explicitly record the caliph ordering the execution of prisoners who had received  at Fakhkh.

Many Alids managed to escape the battle by mingling with the pilgrims. Among them were Yahya ibn Abdallah and his brother Idris. Idris eventually moved to the Maghreb, and in 789 established the Idrisid dynasty in the area of modern Morocco, while his brother Yahya raised a revolt in Daylam in 792. At the news of the Alids' defeat, al-Umari burned the houses of the Alids and their supporters and confiscated their properties.

Impact
Shi'a sources proclaim that Husayn's uprising had a "Zaydi" character, i.e., a social dimension which distinguishes it from the mostly "legitimist" revolt of Muhammad al-Nafs al-Zakiyya. The formula of the oath of allegiance sworn to Husayn was similar to that of Zayd ibn Ali in 740, including promises to defend the oppressed and redress injustices. Veccia Vaglieri points out that in Husayn's formula, "the duty of the subjects to obey him depended on his keeping the promises which he had made", something emulated a century later by al-Hadi ila'l-Haqq Yahya, when he founded a Zaydi state in Yemen. During his brief residence in Medina, he also promised liberty to the slaves who joined him, but faced with protests by their masters that this was an unlawful act, he had to return some of them. 

The wadi of Fakhkh was thereafter known as  ('the Martyrs'), and assumed a prominent position in Shi'a martyrology, since in the number of fallen Alids, it was second only to the Battle of Karbala. The revolt's failure exemplified the weakness of the Alids' position, and also the relative success of al-Mahdi's policies in reducing the danger they posed to the regime. In its aftermath, many Alids dispersed from the Hejaz to the periphery of the Islamic world, in areas such as the Maghreb and northern Iran, with far-reaching repercussions, as they brought Alid loyalties to these regions.

Footnotes

References

Sources
 
 
 
 
 

786
Fakhkh
Fakhkh
History of Mecca
History of Medina
Fakhkh
8th century in the Abbasid Caliphate
Hejaz under the Abbasid Caliphate
History of Shia Islam