Al-Hajjaj was born in ca. 661 in the city of Ta'if in the Hijaz, in modern-day Saudi Arabia. His ancestry was not particularly distinguished: he came of a poor family, whose members had worked as stone carriers and builders. His mother, al-Fari'a, had married, and been divorced by, al-Mughira ibn Shu'ba, appointed governor of Kufa by the first Umayyad caliph, Mu'awiya (r. 661–680). As a boy, al-Hajjaj acquired the nickname Kulayb ("little dog"), with which he was later derisively referred to. His early life is obscure, except for his having been a schoolmaster in his home town—another source of derision to his enemies. He participated in the Second Fitna, fighting in the battles of Harra near Medina (682) and of al-Rabadha (684), but apparently without particular distinction. His first public post, as governor of Tabala in the Tihama region, was also unremarkable.
Soon after Abd al-Malik ibn Marwan (r. 685–705) assumed the throne, al-Hajjaj left his home town and went to the capital, Damascus, where he entered the security force (shurta) of the Caliph. There he attracted Abd al-Malik's attention by the rapidity and efficiency with which he restored discipline during a mutiny of the troops destined to accompany the Caliph in his campaign against Mus'ab ibn al-Zubayr in Iraq.
As a result, the Caliph entrusted him with command of the army's rear-guard. He apparently achieved further feats of valour, so that after the defeat of Mus'ab, Abd al-Malik decided to entrust him with the expedition to subdue Mus'ab's brother, the anti-caliph Abdallah ibn al-Zubayr, in Mecca. In late 691 he set out from Kufa at the head of 2,000 Syrian troops. After taking over Ta'if unopposed, he halted there as Abd al-Malik had charged him to try to secure Ibn al-Zubayr's capitulation by diplomatic means if possible, and to avoid shedding of blood in Mecca. Ibn al-Zubayr however rejected the Umayyad offers, and al-Hajjaj, after receiving reinforcements and the Caliph's permission, moved to attack Mecca. The Umayyad troops bombarded the city with catapults from Mount Abu Qubays, not letting up even during the hajj; even the Ka'aba was not spared, despite the presence of the assembled pilgrims. When a sudden thunderstorm broke out, which his soldiers interpreted as divine wrath, he was able to rally them and convince them that it was actually a sign of victory. Finally, in October 692, after seven months of siege and the defection of several thousand of his supporters, including two of his sons, Ibn al-Zubayr was killed alongside his last remaining loyal followers, fighting around the Ka'aba.
As a reward, Abd al-Malik gave al-Hajjaj the governorship of the Hijaz, Yemen, and al-Yamama. As governor, al-Hajjaj led the hajj in person in the years 73 and 74 AH (693 and 694 CE), and restored the Ka'aba to the shape and dimensions it had originally, rejecting the alterations made by Ibn al-Zubayr following the first Umayyad siege in 683. Al-Hajjaj was able to restore peace in the Hijaz, but his severity occasioned the frequent personal intervention of the Caliph.
In early 694, Caliph Abd al-Malik sent al-Hajjaj to govern Iraq. This involved combining the governorships of Kufa and Basra, which had not been done since the days of Ziyad ibn Abi Sufyan twenty years earlier. The caliph had previously appointed his brother Bishr ibn Marwan governor of Kufa, but when he died in early 694, this "experiment in family rule" (Hugh N. Kennedy) had clearly not been a success, and al-Hajjaj, whose ability and loyalty had been amply demonstrated, was appointed to this crucial post. The governorship of Iraq was indeed "the most important and responsible administrative post of the Islamic state" (A. Dietrich), as it comprised not only Iraq proper, but also included the lands conquered by troops from the two colony towns (misr) of Kufa and Basra, i.e. Persia, Khurasan and the other eastern provinces of the Caliphate. The Governor of Iraq was therefore in charge of a huge super-province or vice-royalty stretching from Mesopotamia to the still expanding borders in Central Asia and the Indian subcontinent, comprising half of the Caliphate's territory and producing more than half its income. In addition, the post was of particular political sensitivity due to the long history of Kharijism and political dissent in Iraq, particularly in Kufa. This discontent was driven by various tribal, economic, and political factors. The population of Kufa contained people from almost all Arab tribes, but also many of those undesired elsewhere, such as the vanquished of the Ridda wars. Although it dominated the fertile lands of the Sawad, many of these were assigned by the Umayyads to princes of the dynasty, while the average Kufan was given land as a stipend for military service; but as the size of the stipend was determined by the earliness of conversion to Islam, many received only minuscule grants. Finally, the Kufans were largely left out of the spoils of conquest in the East; it was the Basrans who secured the lion's share, taking over far more extensive and richer territory like Khurasan or Sindh, while the Kufans were left with the mountains of Jibal and central Persia as their city's sole dependencies. Al-Hajjaj's purview originally excluded Khurasan and Sistan, but in 697/8 he received these two provinces as well, expanding his rule over the entire eastern half of the Caliphate. He remained in this post until his death in 714, and throughout this period, encompassing the remainder of Abd al-Malik's reign and most of that of his successor al-Walid (r. 705–715), he would be "the dominant feature in the sources" (G. R. Hawting).
Al-Hajjaj was, in the words of A. Dietrich, "the most loyal servant that a dynasty could wish for", and his loyalty was reciprocated by Abd al-Malik with his full trust. The relationship was further strengthened through family ties: al-Hajjaj's daughter wed Masrur, son of al-Walid I (r. 705–715), while the daughter of his brother Muhammad was wed to the future Yazid II (r. 720–724); Yazid even named his first-born son after al-Hajjaj, who in turn named his first three sons after members of the dynasty. This close relationship is further evidenced by the many surviving letters exchanged between the two men. Al-Hajjaj's relationship with Abd al-Malik was much different than with the latter's successor, al-Walid, with whom the correspondence was restricted to their official functions. On the other hand, while Abd al-Malik was able to restrain his over-zealous governor whenever he was "extortionate in the raising of taxes, was too liberal with public resources, or was shedding more blood than was necessary" (A. Dietrich), al-Walid considered himself in al-Hajjaj's debt because he had championed the succession of al-Walid against Abd al-Malik's brother Abd al-Aziz ibn Marwan, and the new Caliph allowed his powerful governor free rein and relied heavily on his counsel even in the appointment and dismissal of officials. If his meddling in the succession had secured him the favour of al-Walid, it had also caused the declared enmity of al-Walid's brother Sulayman (r. 715–717). Sulayman furthermore had championed the cause of Yazid ibn al-Muhallab, whom al-Hajjaj had imprisoned. The possibility of Sulayman's accession so frightened al-Hajjaj that he wished not to outlive al-Walid.
Arriving at Kufa, al-Hajjaj gave an inaugural sermon at the local mosque that has become famous and is "often cited as an example of Arab eloquence" (G. R. Hawting). The situation he found there was one of disorder. The troops of Basra and Kufa, ostensibly garrisoned at Ramhurmuz under al-Muhallab ibn Abi Sufra had instead, upon the death of Bishr, left the camp and were idling in the cities. In order to restore discipline, al-Hajjaj announced that any man who did not within three days return to the camp would be put to death and his property be left open to plunder. This proved effective, but when he went to the troops to distribute the pay, al-Hajjaj faced another mutiny under Ibn al-Jarud because of making cuts in pay that the troops refused to accept. These problems overcome, al-Hajjaj sent the troops against the Kharijites. In 696 al-Muhallab defeated the Azariqa who had rallied around Qatari ibn al-Fuja'a as their anti-caliph, and in spring 697 another Kharijite leader, Shabib ibn Yazid, was defeated on the Dujayl river in Khuzistan with the aid of Syrian troops. In the same year, al-Hajjaj suppressed the rebellion of the governor of Mada'in, al-Mutarrif ibn al-Mughira ibn Shu'ba, who had allied with the Kharijites.
These campaigns eradicated the Kharijite rebellion, but came at a cost to his relationship with the Iraqis: the campaigns against the Kharijites were extremely unpopular, and measures like the cuts in pay, according to Hugh N. Kennedy, "[seem] almost to have goaded the Iraqis into rebellion, as if looking for an excuse to break them". The explosion came in 699: when he had been conferred the governorships of Khurasan and Sistan, al-Hajjaj had given it to al-Muhallab, but in Sistan, the situation was far more unstable, and the country had to be essentially reconquered. An army under the local governor Ubayd Allah ibn Abi Bakra had suffered a heavy defeat against the ruler of the kingdom of Zabulistan, known as the Zunbil, and now al-Hajjaj ordered Abd al-Rahman ibn Muhammad ibn al-Ash'ath, the most pre-eminent member of the Kufan aristocracy (the ashrāf) to lead an army against the Zunbil. This army was drawn from the Kufan soldiery, and such was the splendour of its equipment, or perhaps the "proud and haughty manner of the Kufan soldiers and ashrāf who composed it" (G. R. Hawting), that it became known in history as the "Peacock Army". This expedition marked the beginning of a rebellion that came close to destroying not only al-Hajjaj's, but also Umayyad, power in Iraq.
Ibn al-Ash'ath led his army to Sistan, and, as A. Dietrich writes, "at first carried out his campaign carefully and according to orders; he pacified each territory as it was conquered, ensured supplies and accustomed his troops gradually to the different climatic conditions". Al-Hajjaj, however, sent letter after letter to his commander, demanding an immediate assault against the Zunbil. The tone of these letters was extremely offensive, and he threatened to dismiss Ibn al-Ash'ath and appoint his own brother Ishaq to command the expedition instead. Al-Hajjaj's harsh tone and unreasonable demands, as well as the army's evident reluctance to continue such a protracted and arduous campaign so far from their homes, provoked a widespread mutiny, led by Ibn al-Ash'ath himself. The rebel army marched back to Iraq, growing to over 100,000 strong in the process as they were joined by other malcontents, and being transformed from a mutiny against al-Hajjaj—denounced as an enemy of God and a latter-day Pharaoh—to a full-blown anti-Umayyad movement. Al-Hajjaj tried to stop them at Tustar, but the rebels were victorious (early 701). Al-Hajjaj abandoned Basra to the rebels, and Ibn al-Ash'ath entered the city in triumph. Reinforced with Syrian troops, al-Hajjaj managed to score a minor victory, after which the bulk of the rebel army left Basra for their natural stronghold, Kufa. Al-Hajjaj recaptured Basra and pursued ibn al-Ash'ath to Kufa, encamping near the city. Ibn al-Ash'ath's progress had sufficiently alarmed the Umayyad court that they sought a negotiated settlement, even though they kept sending Syrian reinforcements to al-Hajjaj. Abd al-Malik offered to dismiss al-Hajjaj, appoint Ibn al-Ash'ath as governor over one of the Iraqi towns, and raise the Iraqis' pay so that they received the same amount as the Syrians. Ibn al-Ash'ath was inclined to accept, but the more radical of his followers, especially the scholars known as qurrāʾ, refused, believing that the offered terms revealed the government's weakness, and pushed for outright victory. The two armies eventually met in the Battle of Dayr al-Jamajim in April 701, which resulted in a crushing victory for al-Hajjaj and his more disciplined Syrians. Kufa surrendered after that, and al-Hajjaj further undercut Ibn al-Ash'ath's support by promising amnesty to those who surrendered, providing however that they acknowledged that their rebellion had been tantamount to renouncing Islam; those who refused were executed. The remnants of the rebel army fled to Basra, but were soon evicted and pursued by the Syrians to Khuzistan and Sistan. There Ibn al-Ash'ath sought refuge with the Zunbil, but was either assassinated by the latter or committed suicide to avoid being surrendered to al-Hajjaj. Most of his remaining followers tried to reach Herat, but were defeated by al-Muhallab's son, Yazid ibn al-Muhallab, who surrendered those of southern Arab (Yemeni) provenance but let the north Arab (Mudaris) go.
The failure of Ibn al-Ash'ath's revolt led to the tightening of Umayyad control over Iraq. In 702 al-Hajjaj founded the city of Wasit, situated midway between Basra and Kufa, where he moved his seat. There he gathered all Syrian troops present in Iraq, ostensibly in order to rein in the Syrians and prevent excess at the expense of the populace, but in reality his aim was to isolate the Syrians from the locals and solidify their loyalty to him. Henceforth Iraq passed under virtual Syrian occupation, and the Iraqis, regardless of social status, were deprived of any real power in the governance of the region. Al-Hajjaj was now the undisputed master not only of Iraq, but of the entire Islamic East; only the governor of Khurasan, Yazid ibn al-Muhallab, retained some autonomy. Although Yazid was able to refuse several summons to Wasit, finally in 704 al-Hajjaj persuaded the Caliph to dismiss him, and Yazid was put in prison.
As governor of Iraq and viceroy of the East, al-Hajjaj supervised a major wave of expansion. He appointed Muhammad bin Qasim to lead the conquest of the Sindh and northwestern India, Qutayba ibn Muslim to conquer Transoxiana, and Mujja'a ibn Si'r to Oman. Although al-Hajjaj himself undertook no campaign during these years, his role was essential: not only did he select the generals who carried out these campaigns, but also "prepared them very carefully, sparing no expense, since he calculated that with victory he would recover his expenses many times over" (A. Dietrich).
The relationship between al-Hajjāj ibn Yūsuf and Muhammad ibn Qasīm has always been one of great debate. Many accounts list al-Hajjāj as being his uncle or father in law
Already in 695, al-Hajjaj began minting the new gold and silver coins, which superseded the Byzantine and Sasanian coins still used until then. He established mints at Kufa and later in Wasit, under the supervision of a Jew named Sumayr, and decreed strict punishments for counterfeiters. The new coins contained the name of Allah, and hence were initially opposed by many theologians who argued that they would also be used by infidels, but they quickly became a success and "helped to promote the circulation of money and the stabilization of economic conditions" (A. Dietrich). Al-Hajjaj also ordered the translation of the tax registers (diwān) into Arabic from the Persian in which it had hitherto been kept, so that he could supervise it personally.
Following his victory over the Iraqis, al-Hajjaj began a series of reforms aimed at restoring tranquility and prosperity to the troubled state after almost twenty years of civil war and rebellions. He invested much effort in reviving agriculture, especially in the Sawad, and thereby increasing revenue through the kharāj land tax. He began to restore and expand the Sasanian-era network of canals in the lower Iraq. According to al-Baladhuri, he spared no expense to repair embankments when they broke, awarded uncultivated lands to deserving Arabs, and took measures to reverse the flow of the rural population to the cities, especially the new converts (mawālī).
As part of his efforts to strengthen uniformity in the state, he also tried to introduce a definitive, uniform version of the Quran so as to eliminate theological quarrels. The division of the text into thirty parts (ajzā) seems to have been part of this reform. Al-Hajjaj's version also probably included new vowel diacritics, and purged the text of any references hostile to the Umayyads. He declared this version to be the only valid one, while prohibiting the use of Ibn Mas'ud's qirā'a.
Al-Ḥajjāj died at Wasit, in Iraq, in 714. The year after, al-Walid died as well, and his brother Sulayman ibn ‘Abdi l-Malik came to power. Sulayman was indebted to many opponents of al-Ḥajjāj for their political support in getting him elected Caliph, so he recalled all of al-Ḥajjāj's generals and had them tortured to death in prison.
The Chach Nama is the oldest chronicle of the Arab conquest of Sindh.
The primary reason noted in the Chach Nama for the expedition by al-Hajjaj against Raja Dahir, was the raid by pirates off the coast of Debal, resulting in the capturing both gifts to the caliph from the King of Serendib (modern Sri Lanka) as well as the female pilgrims on board who were captured.
The Chach Nama reports that upon hearing of the matter, al-Hajjaj wrote a letter to the Raja, and upon unsuccessful resolution being reached, launched a military attack. Other reasons attributed to al-Hajjaj's interest was in (1) gaining a foothold in the Makran, Balochistan and Sindh regions, (2) protecting the maritime interests, and (3) to teach the armies from Sindh a lesson, for participating alongside Persians in various battles such as those at Nahawand, Salasal and Qādisiyyah and the granting of refuge to fleeing rebel chieftains.
The two sons of al-Muhallab, an Azdi former governor of Khorasan and a military commander under al-Hajjaj, took refuge in Palestine with two Azdi retainers of the governor there, finding themselves now hounded angrily by al-Hajjaj against a background of inter-tribal rivalry and accused by him of embezzlement. The caliph, al-Walid I, issued an order to his brother, Sulayman ibn Abd al-Malik, the pro-Azdi governor of Palestine, to send the sons of al-Muhallab to Damascus. Sulayman sent the elder brother, Yazid, and his own son in chains to the caliph, who, however, showed them mercy.
Al-Hajjaj killed four companions (sahaba) of Muhammad, Abd Allah ibn al-Zubayr, Jabir ibn Abd-Allah, Sa'id ibn Jubayr and Kumayl ibn Ziyad. While besieging the city of Mecca, Al-Hajjaj crucified Abd Allah ibn al-Zubayr and said, "No one can take down his body except Asma (daughter of the late caliph Abu Bakr); she must come to me and ask permission of me, and only then will his body be taken down".
He is recorded by Tha'ālibī (Laţ'āif, 142) as one of the four men to have killed more than 100,000 men (the others being Abu Harb, Abu Muslim and Babak). It was mostly due to his numerous campaigns and the many uprisings and revolts against the empire during his reign.