Islamic Heritage
Encyclopedia

Battle of Khandaq

The Battle of Khandaq (627 CE), also called the Battle of the Trench, was a twenty-seven-day siege of Medina by a coalition of some ten thousand Quraysh and allied tribes. On Salman al-Farsi's advice the Muslims dug a defensive trench, and the coalition withdrew without a decisive battle.

⚔️Decisive Battles of Islamic History

Battle of Khandaq

The Battle of Khandaq (Arabic: غزوة الخندق, Ghazwat al-Khandaq, Battle of the Trench) or Battle of the Confederates (Ghazwat al-Ahzab) was fought in February and March of 627 CE (Shawwal to Dhu al-Qa'dah, 5 AH) and consisted of a twenty-seven-day siege of Medina by a coalition force estimated at approximately ten thousand warriors. The coalition was assembled and commanded by Abu Sufyan ibn Harb of the Quraysh and included the powerful Ghatafan confederation and contingents from several other tribes. Against this force the Muslim community of Medina could field roughly three thousand men. Prophet Muhammad adopted a defensive strategy proposed by Salman al-Farsi -- the digging of a continuous trench across the open northern approaches to the city -- that proved sufficient to prevent the coalition from engaging the Muslim force directly. After nearly a month of stalemate, the coalition withdrew, its unity shattered by a diplomatic operation conducted by Nu'aym ibn Mas'ud that caused each component of the coalition to suspect the others of treachery.

The Battle of Khandaq followed the inconclusive Battle of Uhud in 625 CE, which had inflicted serious losses on the Muslims but had not achieved the Quraysh's strategic objective of destroying the Muslim state. The Khandaq campaign was the Quraysh's last major attempt at a direct military solution. Its failure, and the subsequent shift in the balance of power it represented, opened the way to the Treaty of Hudaybiyyah in 628 CE and the eventual Muslim entry into Mecca in 630 CE. The two years between Khandaq and Hudaybiyyah marked the tipping point at which the question of who would dominate the Arabian Peninsula shifted decisively toward the Muslim community.

The Geopolitical Situation After Uhud

The two years between the Battle of Uhud (March 625 CE) and the Khandaq campaign (February 627 CE) were a period of intensified pressure on the Muslim community from multiple directions simultaneously. The Battle of Uhud had not produced the clean Qurayshi victory Abu Sufyan needed. The Muslims had suffered heavy casualties -- seventy dead, including Hamza ibn Abd al-Muttalib -- and the Prophet himself had been wounded. But Medina remained in Muslim hands, the Prophet was alive, and the community had reconstituted itself within days, mounting a pursuit expedition to Hamra al-Asad before the Qurayshi army had reached home. To the tribal communities watching from the Hijaz and Najd, the outcome looked less like a decisive Qurayshi victory than a prolonged draw that had exhausted both sides without resolving anything.

In the period after Uhud, a series of smaller conflicts and political maneuvers reshaped the landscape of Arabian alliances. The expulsion of the Banu Nadir from Medina in 625 CE was particularly consequential. The Banu Nadir were one of the three major Jewish tribes of Medina who had a treaty relationship with the Muslim community. The Prophet accused them of plotting his assassination -- the sources describe a specific incident in which the Banu Nadir allegedly planned to drop a boulder on the Prophet while he sat beneath a wall in their quarter -- and ordered their expulsion after a fifteen-day ultimatum. The Banu Nadir departed Medina, some going to the oasis of Khaybar to the north and others, under their chief Huyayy ibn Akhtab, traveling to Khaybar and then south to Mecca itself. The departure of Huyayy ibn Akhtab and his faction to Mecca was not a passive withdrawal: it placed in the Qurayshi capital some of the most knowledgeable, most motivated, and most organizationally capable opponents of the Muslim community, men who had resources, connections across Arabia, and an intense personal interest in the Muslim community's destruction.

Within Medina itself, the Muslim community faced the ongoing challenge of managing a population that was not uniformly committed to the new order. The group the Quran designates as the munafiqun -- the hypocrites, those who outwardly conformed to Islamic practice while privately opposing or doubting it -- remained present in the city and continued to create friction. Abd Allah ibn Ubayy ibn Salul, who had withdrawn his three hundred men from the Uhud campaign on the eve of the battle, was still in Medina. His continued presence, and the Prophet's consistent refusal to move against him or expel him, was itself a deliberate policy: the Prophet judged that the damage of executing or expelling someone who had outwardly accepted Islam exceeded the damage of tolerating a known internal opponent. This calculation held throughout the period up to and including the Khandaq campaign.

Outside Medina, the situation was also unstable. Several military expeditions between Uhud and Khandaq -- including the Bi'r Ma'una disaster, in which approximately seventy Muslim teachers sent to instruct a tribe in Najd were ambushed and killed, and the Raji' incident, in which six Muslim scouts were similarly betrayed -- reflected the degree to which the Muslim community was still operating in a hostile regional environment. These episodes were not incidental: they reflected a coordinated pattern of Qurayshi-backed subversion of Muslim attempts to extend their influence and alliances into the tribal networks of central Arabia. The Quraysh, having failed to destroy the Muslim community at Uhud, were pursuing a strategy of incremental attrition -- wearing down Muslim manpower and morale through proxies and ambushes while assembling the larger coalition force that would eventually march on Medina. The Bi'r Ma'una massacre in particular produced a significant temporary decline in the capacity of the Muslim community to project influence, since seventy of the most capable teachers and reciters of the Quran were killed in a single engagement. The Prophet's grief at the loss -- documented in multiple hadith sources as the occasion for a sustained period of prayer against those responsible -- reflects the severity of the blow.

The Formation of the Ahzab Coalition

The organization of the coalition that would march on Medina in 627 CE was the most sophisticated diplomatic and military operation the Quraysh had yet attempted. It was driven primarily by Huyayy ibn Akhtab and other leaders of the exiled Banu Nadir, who traveled between Mecca and the various tribal confederations of the Hijaz and Najd to assemble the alliance.

Huyayy ibn Akhtab arrived in Mecca in approximately 626 CE and presented the Quraysh leadership with a straightforward argument: the Muslim community in Medina was a threat to everyone who benefited from the existing Arabian order -- to Qurayshi trade, to Ghatafani raiding routes, to the tribal autonomy of groups throughout the peninsula. The previous campaigns (Badr, Uhud) had failed because they had been Qurayshi campaigns with limited allied participation. A campaign large enough to overwhelm Medina's defenses required a true coalition, and the Banu Nadir, with their connections across Arabia and their resources from Khaybar's agricultural wealth, were positioned to build it.

The Quraysh agreed to lead the coalition and committed their full military strength -- approximately four thousand warriors drawn from the Quraysh and their Kinana allies. Abu Sufyan ibn Harb took overall command. The decision to commit to this campaign represented a significant gamble: the Quraysh were pledging their entire military capacity to a single operation, which meant that a second failure would leave them with no reserve and no ability to mount another direct attempt for years.

The Ghatafan confederation was the second major component of the coalition, and securing their participation was Huyayy ibn Akhtab's most important early diplomatic achievement. The Ghatafan were a large tribal confederation based in the Najd, east of Medina, and they consisted of several major sub-tribes. The Fazara, led by Uyayna ibn Hisn, were the largest and most militarily capable. The Murra, under Harith ibn Awf, were smaller but well-positioned geographically. The Ashja, under Mis'ar ibn Rukhaylah, completed the Ghatafan contribution. Together, the Ghatafan brought approximately six thousand warriors to the coalition -- more than the Quraysh themselves -- and their involvement transformed the campaign from a Qurayshi expedition with auxiliary support into a genuinely multi-tribal coalition war.

The incentive structure for the Ghatafan's participation is documented with unusual specificity in the sources. The Banu Nadir, drawing on the agricultural wealth of Khaybar, promised the Ghatafan half of the annual date harvest of Khaybar in exchange for their participation. This was a substantial material commitment: Khaybar's date groves were among the most productive in Arabia, and the promised share represented real wealth. The transaction reveals the degree to which the coalition was not merely ideological opposition to Islam but a negotiated arrangement with material incentives for each component -- incentives that would become a vulnerability when the siege stalled and the promised rewards remained uncollected.

Additional contributions came from other tribal groups. The Banu Sulaym, a tribe with territory along the route between Mecca and Medina, sent contingents. The Banu Asad contributed fighters. Several smaller tribal groupings from the Hijaz added their numbers. By the time the coalition was fully assembled outside Medina, the sources give a total of approximately ten thousand warriors -- a force unprecedented in the history of pre-Islamic Arabian warfare. Previous campaigns of this scale simply had no precedent; the Battle of Badr had involved roughly one thousand men total on both sides, and the coalition at Uhud had numbered three thousand Qurayshi warriors. The Ahzab campaign was three times the size of Uhud on the coalition side alone.

Muslim intelligence of the coalition's formation came through multiple channels. The Prophet's uncle Abbas ibn Abd al-Muttalib, who remained in Mecca as an intelligence source throughout the early Medinan period, sent word of the coalition's assembly. Tribal contacts and the movement of large numbers of armed men across the peninsula were impossible to conceal entirely. By the time the coalition began its march toward Medina, the Muslim community had enough advance warning to begin preparations, though the scale of what was coming was still being assessed as the defenders organized their response.

Salman al-Farsi and the Trench Strategy

The council that Prophet Muhammad convened to plan the defense of Medina faced an asymmetry that made conventional responses insufficient. Seven hundred men at Uhud, fighting a three-thousand-strong Qurayshi army with the mountain at their back, had nearly held their ground -- they had failed only because of a specific, preventable tactical error. Three thousand Muslim fighters against ten thousand coalition warriors, without any comparable terrain advantage, could not expect to hold an open-field engagement. The mathematics of the conventional defensive options -- sally out and fight in the open, or defend within the city street by street -- were both unfavorable.

It was in this consultation that Salman al-Farsi proposed the trench. Salman's background is itself historically significant. He was a Persian from the region of Isfahan, born to a Zoroastrian family, who had undergone a long religious journey -- through Zoroastrianism, then into contact with Christian communities in Syria and elsewhere, eventually arriving in Arabia in search of the prophet he believed was coming, and finding the Prophet Muhammad in Medina. His conversion to Islam is documented in the hadith literature in considerable detail. The fact that he proposed a defensive strategy derived from Persian military practice is therefore consistent with his identity: he was not a Hijazi Arab drawing on Arab military tradition, but a man who had grown up in a civilization with centuries of experience in fortification, siege warfare, and defensive engineering.

The trench -- khandaq in Arabic, from the Persian kandak -- was a standard element of Sassanid Persian military doctrine. Persian armies both built trenches as defensive positions and confronted enemy trenches in siege operations. The concept of using an excavated linear obstacle to block cavalry and prevent the kind of flanking maneuver that had decided Uhud was well-established in the Persian military tradition Salman knew. In the context of Arabian warfare, however, it was completely novel. Arabian military culture was based on mobile cavalry and infantry engagements in open terrain; fortification existed (Medina itself had several stone forts), but linear field fortifications of the kind Salman proposed had no precedent in the region.

The sources record that Salman's proposal was adopted immediately. The Prophet approved it, the senior companions concurred, and the decision was made to excavate a trench across the open northern and northwestern approaches to Medina. The city's southern and southeastern edges were protected by lava fields (harrat) that were impassable to cavalry; the date-palm groves to the east provided some natural obstacle; it was the northern approach, the flat plain between the settled areas of Medina and the lower slopes of Mount Uhud beyond, that was genuinely open and vulnerable to a large cavalry force.

The construction operation that followed was one of the most remarkable collective engineering efforts in early Islamic history. The trench was approximately five to five-and-a-half kilometers long, running in a rough arc across the northern exposure of the city. It was excavated to a depth and width that would prevent horses from jumping across -- the sources describe measurements of approximately four to five meters wide and three meters deep, dimensions calibrated specifically to stop cavalry while remaining excavatable in the time available. The excavated earth was piled on the Medina side of the trench to create an additional barrier and to give defenders a slight elevation advantage.

The labor allocation was systematic. The Prophet divided the trench's length among groups of ten men, each responsible for excavating their assigned section. The entire community participated: the Muhajirun and Ansar worked in parallel sections, maintaining a competitive but cooperative pace that the sources describe as accompanied by work songs. The Prophet himself participated in the digging, which the sources document in specific detail -- he carried earth, he used a pickaxe, he worked alongside the men -- and this personal participation was both practically important (the project required every available worker) and symbolically significant (there was no class exemption from the labor).

The construction took approximately six days by most accounts, though some sources give a longer period. Working against a winter deadline -- the coalition was known to be assembling and would arrive within days or weeks -- the pace was intense. Food was scarce during the construction period, and several accounts in the hadith literature describe miraculous episodes connected to the shortage: a small amount of food that fed the entire workforce, a stone that the Prophet struck with his pickaxe breaking apart with a flash that the Prophet interpreted as a vision of future Muslim conquests in Persia, Syria, and Yemen. Whether these accounts are taken as historical events or as later theological elaborations, they reflect the tradition's sense of the construction period as a moment of extraordinary communal effort under extreme pressure.

The completed trench ran from the lava field on the east to the slopes of Jabal Dhubab on the west, sealing the northern approach. Archers and spearmen were stationed at intervals along the Medina side of the trench, positioned to repel any attempt at crossing. The Muslim camp was positioned behind the trench with the bulk of Medina's structures to the rear. The strategic logic was straightforward: the trench would neutralize the coalition's most dangerous arm (cavalry), force any assault into a narrow-front infantry engagement against prepared defenses, and buy time for the coalition's cohesion to erode. Whether that cohesion would erode before the Muslim defenses were overwhelmed was the central uncertainty of the campaign.

The Coalition's Arrival and the Stalemate at the Trench

The coalition forces arrived before Medina in late Shawwal or early Dhu al-Qa'dah of 5 AH (roughly late February or early March 627 CE) and encountered the trench immediately. The reaction of the coalition commanders to the defensive barrier is described in the sources with a mixture of surprise and frustration: this was not how Arabian battles were fought, and the coalition's plans -- which assumed a mobile engagement in which their numerical and cavalry superiority could be brought to bear -- had no direct application to what they found.

Abu Sufyan established the main Qurayshi camp to the northwest of the trench, near a place called Rumah. The Ghatafan contingent under Uyayna ibn Hisn of the Fazara camped separately to the east, near a valley called Aqa'iq. This geographic separation of the two main coalition components -- the Quraysh to the northwest, the Ghatafan to the east -- was partly dictated by the terrain and the logistics of camping ten thousand men, but it also reflected the coalition's structure: this was an alliance of distinct tribal groups with distinct interests, not a unified army with unified command.

For the first days of the siege, the coalition attempted to find weak points in the trench or sections narrow enough for horses to cross. Several probing attacks were conducted at various points along the line, each of which was repelled by the Muslim archers and spearmen manning the trench's bank. The terrain to the north and west of the trench offered the coalition ample space to maneuver their cavalry, but cavalry that cannot cross an obstacle is cavalry that cannot engage. The investment in the six days of construction had purchased exactly what the Prophet and Salman al-Farsi had calculated it would purchase: a tactical nullification of the coalition's principal military advantage.

The psychological pressure of the siege extended into the Muslim camp in ways that the sources document candidly. The Quran's verse describing the believers as having "eyes growing wild and hearts reaching throats" (33:10) is understood by the classical commentators as a description of the genuine fear that ran through the community during the siege's most difficult days -- when the Banu Qurayza's defection became known, when food was scarce, when the cold was severe, and when the coalition forces were visible in their thousands beyond the trench. The sources also record, without apparent embarrassment, instances of the munafiqun using the crisis to argue that the siege proved Muhammad's promises of divine protection were false, and that individuals would be better off withdrawing to protect their own families and property. The Prophet had to deal with these internal pressures while managing the external siege -- a dual challenge whose difficulty the sources acknowledge even as they describe his consistent composure in responding to it.

The most significant breach attempt of the entire siege occurred when a group of Qurayshi horsemen, led by Amr ibn Abd Wudd al-Amiri, found or forced a narrow crossing at a constricted section of the trench and crossed to the Medina side with a small party. Amr ibn Abd Wudd was a warrior of considerable reputation -- the sources describe him as equivalent to a thousand horsemen -- and his crossing, even with a small group, represented a genuine crisis: if a bridgehead could be established on the Medina side of the trench, the entire defensive strategy would unravel.

Ali ibn Abi Talib led the Muslim response. He closed off the crossing point with a group of men to prevent reinforcement from the coalition side, and then engaged Amr ibn Abd Wudd in single combat. The duel that followed -- Amr was mounted, Ali on foot for at least part of the encounter, the exchange of verbal challenges and responses in the formal tradition of Arabian combat -- ended with Ali killing Amr. The rest of the small Qurayshi force that had crossed retreated or were killed. The breach was sealed. The significance of the episode extended beyond its tactical resolution: it demonstrated that even when the trench was crossed, the Muslim defenders could defeat the coalition's best fighters in individual engagement, and it gave the Muslim community a visible victory in a siege that otherwise offered little opportunity for decisive action. Ali's killing of Amr ibn Abd Wudd became one of the most celebrated episodes of his early career and was cited repeatedly in subsequent discussions of his military capabilities.

The siege settled into a grinding stalemate. The coalition launched periodic archery attacks against the Muslim positions, and the Muslims responded in kind. Individual duels were occasionally conducted across or near the trench. Night raids were attempted by both sides in the darkness. But the fundamental geometry of the situation did not change: the trench prevented the coalition from deploying their cavalry advantage, and without cavalry superiority the coalition's numerical advantage was much reduced. The sources record that the Muslim defenders worked rotating watches through the nights, maintaining constant vigilance along the trench's length, and that the cold (it was late winter) and the shortage of food made the conditions on the defensive side increasingly difficult. The Prophet's personal presence at the front, moving along the trench, leading the prayers, and sharing the cold and hunger with the defenders, was a constant element of the accounts.

Nu'aym ibn Mas'ud and the Diplomatic Dissolution of the Coalition

The tactical stalemate that the trench had created did not by itself end the siege. The coalition had the resources and the numbers to maintain a siege indefinitely if its constituent parts remained unified and motivated. What dissolved the coalition was not military defeat but the deliberate destruction of trust among its components -- a diplomatic operation of remarkable subtlety conducted by a single man, Nu'aym ibn Mas'ud al-Ashja'i.

Nu'aym ibn Mas'ud was a member of the Ashja' tribe, which was one of the Ghatafan groups participating in the coalition. He had secretly converted to Islam during the siege -- according to the sources, he came to the Prophet at night, declared his conversion, and asked what he could do to serve the Muslim cause. The Prophet told him that war was deception (al-harb khid'a) and authorized Nu'aym to act as a secret agent within the coalition, doing whatever he could to undermine its unity. Nu'aym's conversion was known only to the Prophet and a handful of others; to the coalition he remained a fellow tribesman, a trusted Ghatafani warrior.

Nu'aym's plan was elegant in its use of the coalition's structural vulnerabilities. The Ahzab coalition was held together by negotiated incentives and mutual interest, not by deep ideological commitment or personal loyalty to a single leader. The Ghatafan had been promised Khaybar's date harvest but had not received it yet. The Quraysh needed the Ghatafan's numbers but had their own separate interests and agenda. The Banu Qurayza had agreed to break their treaty with the Muslims and support the coalition, but they too had their own survival interests that did not necessarily align with the coalition's objectives. Nu'aym recognized that if each component of the coalition could be made to suspect the others of planning a separate deal -- leaving them exposed while others made peace -- the coalition's incentive to maintain unity would dissolve.

The operation proceeded in three separate movements. First, Nu'aym visited the Banu Qurayza in their fortified quarter within Medina. He had been a personal friend of the tribe before the events of the siege, and he used this relationship to gain access. He warned the Banu Qurayza leadership -- addressing specifically Ka'b ibn Asad, the tribe's chief -- that the Quraysh and Ghatafan, if the siege failed, would simply withdraw and leave the Banu Qurayza alone in Medina to face Muslim retaliation. The Quraysh and Ghatafan had their homes to return to; the Banu Qurayza, having broken their treaty with the Muslims, would have nowhere to go. Nu'aym suggested that the Banu Qurayza should therefore demand hostages from the coalition -- prominent Qurayshi and Ghatafani leaders held as guarantors of the coalition's commitment -- before committing to any active support of the siege.

Second, Nu'aym went to Abu Sufyan and the Qurayshi leadership and told them, in confidence, that the Banu Qurayza were regretting their decision to break the treaty with the Muslims and were planning to approach the Prophet and offer to hand over hostages from the Quraysh and Ghatafan as a gesture of reconciliation. This was entirely fabricated, but it was plausible given the Banu Qurayza's exposed position. Nu'aym advised the Quraysh to reject any such approach from the Banu Qurayza.

Third, Nu'aym went to the Ghatafan leadership -- men he knew personally as fellow tribesmen -- and delivered the same fabricated message about Banu Qurayza's alleged plan to hand over Ghatafani hostages.

The operation's mechanics then played out exactly as Nu'aym had designed. The coalition leadership, now convinced that the Banu Qurayza were unreliable and potentially about to betray them to the Muslims, sent an envoy to Ka'b ibn Asad demanding that the Banu Qurayza demonstrate their commitment by attacking the Muslim positions immediately. Ka'b ibn Asad, remembering Nu'aym's warning that the coalition would abandon them if things went badly, demanded coalition hostages as a guarantee before the Banu Qurayza would act. The Quraysh and Ghatafan, now convinced from Nu'aym's separate visits that this demand for hostages was exactly the suspicious overture he had warned them about, refused. The Banu Qurayza, reading the refusal as confirmation of Nu'aym's warning that the coalition would leave them exposed, withdrew further from active coordination with the besieging forces.

The sources describe this sequence of mutual suspicion with considerable narrative pleasure -- it reads in the Arabic historical accounts almost as a story within a story, and the precision of Nu'aym's construction, exploiting each party's specific fear about being abandoned by the others, is documented in enough detail to reconstruct the operation's architecture. The effect was to dissolve the coalition's most dangerous potential move -- a coordinated attack with the Banu Qurayza opening a second front within Medina while the coalition pressed the trench from outside -- before it was ever executed.

The Nu'aym operation also illustrates something important about the nature of the coalition itself. A unified army with genuine shared purpose and deep mutual trust would not have been vulnerable to the kind of manipulation Nu'aym conducted. Each party's readiness to believe the worst of the others -- the Quraysh believing the Banu Qurayza would sell them out, the Ghatafan believing the same, the Banu Qurayza believing the coalition would abandon them -- reflected the structural reality of the Ahzab alliance: it was a negotiated arrangement among parties with different interests, held together by expected material gain and a shared enemy, not by any deeper solidarity. When the expected gain (a quick victory, the promised Khaybar harvest) failed to materialize and the shared enemy proved more resilient than anticipated, the alliance's vulnerabilities became acute. Nu'aym's genius was to recognize and exploit those vulnerabilities with remarkable economy of means -- three conversations, carefully sequenced, each exploiting a specific existing anxiety rather than inventing new ones. The Prophet's authorization of the operation, and his framing of it as an application of the principle that war permits deception, became a reference point in subsequent Islamic discussions of permissible intelligence operations and military ruses.

The Banu Qurayza Episode

The Banu Qurayza were the last of the three major Jewish tribes of Medina still present in the city when the Khandaq siege began. The Banu Qaynuqa had been expelled in 624 CE after a conflict following Badr; the Banu Nadir had been expelled in 625 CE. The Banu Qurayza had a treaty with the Muslim community that specified mutual defense obligations, and when the coalition assembled outside Medina, they were the only significant organized group within the city that was not Muslim.

The tribe's decision to break this treaty during the siege is the central historical and moral controversy of the Khandaq episode. The sources agree on the basic sequence: Huyayy ibn Akhtab of the Banu Nadir traveled to the Banu Qurayza's fortified quarter and persuaded Ka'b ibn Asad, the tribe's chief, to abandon the treaty with the Muslims and align with the coalition. Ka'b ibn Asad's initial resistance -- he reportedly told Huyayy that Muhammad had never broken a commitment to him, and that abandoning the treaty was dishonorable -- was overcome after sustained pressure and Huyayy's guarantee that if the siege failed, Huyayy himself would enter the Banu Qurayza's fortress and share whatever fate awaited them. Ka'b eventually agreed, and the Banu Qurayza formally declared the treaty void.

When the Prophet received confirmation of the Banu Qurayza's defection through scouts he had sent to verify the reports, the effect on the Muslim defenders was severe. The Banu Qurayza controlled fortified positions to the southeast of the main Muslim encampment -- positions that, if used aggressively, could allow attacks on the Muslim rear or on the residential areas of Medina where the non-combatant population had been concentrated. The Muslim force was already stretched thin along the trench; a second front from the Banu Qurayza's direction would have required redistributing men who were needed at the trench. The Prophet sent a delegation -- including Sa'd ibn Mu'adh of the Aws and Sa'd ibn Ubada of the Khazraj -- to assess the situation. The delegation returned with confirmation of the worst: the Banu Qurayza had indeed broken the treaty, and their representatives had spoken with deliberate contempt to the Muslim envoys, making clear that they no longer recognized any obligation toward the Muslim community.

In the event, the Banu Qurayza took no significant offensive action during the siege itself -- whether because of Nu'aym's diplomatic operation, which had broken down the coordination between the Banu Qurayza and the coalition, or because the tribe's leadership remained divided about how far to go, or because they were observing the siege's outcome before committing fully. The immediate military crisis passed without the feared second front materializing. But the treaty violation was not forgotten.

After the coalition's withdrawal, the Prophet moved immediately against the Banu Qurayza. The sources are very specific about the timing: the Prophet had not yet laid down his armor when the angel Jibril appeared (according to the Islamic narrative) commanding that the army march against the Banu Qurayza without delay. Whether or not one accepts the supernatural element of this account, the historical reality is that the siege of the Banu Qurayza's fortified quarter began within hours of the Ahzab coalition's withdrawal. The Muslim army surrounded the Banu Qurayza's stronghold and maintained the siege for approximately twenty-five days, at which point the tribe surrendered without terms, placing themselves at the disposal of the Muslim community.

The question of what punishment would be applied was resolved through an unusual procedure: the Banu Qurayza, drawing on the Aws tribe's traditional role as their protectors and allies, requested that the judgment be given to Sa'd ibn Mu'adh, the chief of the Aws and a man who had been their ally before the rise of Islam. Sa'd ibn Mu'adh had been wounded during the Khandaq siege by an arrow that had struck his arm and severed the brachial vein; he was being treated in the mosque and was clearly dying from the wound when he was brought to render judgment. His decision was severe: the men of the Banu Qurayza who had participated in the breach of the treaty were to be executed; the women and children were to be taken captive; the tribe's property was to be distributed among the Muslims.

The execution that followed was carried out on the men of the Banu Qurayza at the marketplace of Medina. The number of those killed is given variously in the sources as between four hundred and nine hundred, with W. Montgomery Watt and other modern scholars generally placing the figure at the lower end of this range. Huyayy ibn Akhtab, who had kept his promise to Ka'b ibn Asad and had entered the Banu Qurayza's fortress when the siege began, was among those killed.

The Banu Qurayza episode is the most discussed and contested episode in the entire Khandaq narrative. Western academic historians from the nineteenth century onward have debated the event in terms of its historicity (whether the sources' accounts are reliable), its morality (whether the judgment can be defended by any standard), and its legal framing (whether Sa'd ibn Mu'adh's judgment was, as the Muslim tradition claims, derived from biblical law). The modern scholarly consensus, represented by Watt's work and Lecker's more recent studies, takes the event as historical while debating its specific details. The Islamic tradition's claim that Sa'd applied the law of Deuteronomy 20:12-14, which prescribes death for men of a besieged city that does not make peace, is taken seriously by some scholars as a historically plausible framing and dismissed as apologetic by others.

The historical context that shapes any serious assessment of the event includes several factors that the sources themselves make explicit. The Banu Qurayza had broken a treaty with a community under existential siege at the moment of maximum danger. The treaty's military defense obligations were precisely what had been violated: the Banu Qurayza did not merely fail to help the Muslims, they actively coordinated with the enemy and opened negotiations about attacking the Muslim rear. Ka'b ibn Asad's initial resistance to Huyayy's overtures -- his statement that Muhammad had never broken a commitment to him -- makes clear that the treaty's obligations were understood and deliberately abandoned. The political logic of Sa'd ibn Mu'adh's judgment, from the perspective of a tribal leader in seventh-century Arabia, was not arbitrary severity but a response calibrated to the norm that treaty violation in wartime, particularly at a moment that nearly led to the community's destruction, required a response severe enough to deter repetition. Whether that logic is acceptable by any modern standard is a different question from whether it was historically comprehensible within its own context.

What is not contested is that the event ended the organized Jewish presence in Medina. The Banu Qaynuqa had been expelled in 624, the Banu Nadir in 625, and the Banu Qurayza were now destroyed in 627. The transformation of Medina from a city with a substantial Jewish population and organized Jewish tribal entities into a predominantly Muslim city was completed by these three episodes in rapid succession. The political and social consequences of this transformation for the subsequent history of Medina and of early Islam were substantial. The Jewish communities of Khaybar, Fadak, and other northern oases would remain as organized entities for several more years until the Khaybar campaign of 628 CE brought them under Muslim authority as well, but within Medina itself the plural community of the Constitution of Medina's early years no longer existed after the Khandaq's aftermath.

The Collapse of the Siege: Wind, Withdrawal, and Abandonment

The military stalemate at the trench, the diplomatic disruption of coalition unity by Nu'aym ibn Mas'ud, and the failure of the Banu Qurayza to provide the second front that might have broken the Muslim defenses all contributed to the coalition's deteriorating situation. The siege entered its final phase approximately two to three weeks after it began, with the coalition forces increasingly frustrated, cold, and poorly supplied.

The Quran's account of the coalition's withdrawal attributes it to a divinely sent wind: "We sent against them a wind and forces you could not see" (33:9). The historical sources -- most importantly al-Waqidi, who provides the most detailed tactical account of the Khandaq campaign -- describe specific meteorological conditions: a wind from the east that blew for three days and nights, overturning tents, scattering fires, making it impossible to maintain cooking fires, and creating misery throughout the coalition camp. In the context of a February-March campaign in the Hijaz, where winter temperatures at night can be bitterly cold and where the wind in particular valleys can reach significant force, this is entirely plausible as a natural event. Whether it was also a divinely directed event is a matter of theological conviction, not historical analysis.

The wind alone did not end the siege, but it combined with everything else that had gone wrong for the coalition to tip Abu Sufyan toward the decision to withdraw. The specific circumstances of the decision are described in the sources with vivid detail: Abu Sufyan gathering the coalition leaders during a particularly miserable night, reviewing the situation -- no progress at the trench, the Banu Qurayza uncertain, supplies running short, the men cold and demoralized -- and concluding that the enterprise had become impossible. He declared the withdrawal, and the coalition forces departed in the darkness, abandoning their camp equipment and supplies.

The withdrawal was essentially a flight. The sources describe the speed with which the coalition forces dispersed: the Ghatafan headed northeast toward their territories in the Najd, the Quraysh southwest toward Mecca, the smaller tribal contingents in their respective directions. By the morning after the withdrawal decision, the plain that had held ten thousand warriors was empty. The Muslim defenders, who had been maintaining their watches through the night, found the coalition camp deserted when dawn came.

The Prophet is reported to have said, after the withdrawal: "Now we will attack them; they will not attack us. We will advance on them." This statement, recorded in multiple hadith collections, captures the shift in the strategic situation that the Khandaq campaign had produced. Before Khandaq, the question had been whether the Muslim community could survive the Quraysh's offensive pressure. After Khandaq, the initiative had passed.

Immediate Aftermath: Sa'd ibn Mu'adh and the Community's Condition

The Muslim community's condition after the siege was one of profound relief mixed with exhaustion and grief. The twenty-seven days of constant vigilance, cold, inadequate food, and physical labor had taken a significant toll. Six Muslims had been killed during the siege -- a relatively small number given the duration of the confrontation, reflecting the degree to which the trench had succeeded in preventing direct combat. The Qurayshi dead were similarly few: about three men from the coalition side.

The wound Sa'd ibn Mu'adh had received during the siege -- an arrow from a Qurayshi archer that had struck his arm during a moment when the Prophet prayed for victory -- had been treated but was clearly fatal. He survived long enough to render his judgment on the Banu Qurayza and to hear the Prophet's statement that it matched the judgment of God from above the seven heavens. He then died from the wound, and his death was mourned publicly by the Prophet and the community. The sources describe the Prophet weeping at Sa'd's funeral, which was attended by seventy thousand angels according to the Islamic narrative tradition -- a detail that reflects the extraordinary esteem in which Sa'd was held. He was approximately thirty-seven years old.

The Prophet's own physical state after the siege is described in terms that convey exhaustion: he had maintained the watches, led the prayers, managed the coalition diplomacy, and absorbed the crisis of the Banu Qurayza's defection, all while managing the day-to-day welfare of the three thousand men in the camp. The sources describe him washing the dust of the campaign from himself after the coalition's withdrawal, indicating both the physical conditions of the siege and the sense of completion that the withdrawal represented.

The Quranic Account: Surah Al-Ahzab

The Battle of Khandaq is addressed directly in the Quran in Surah Al-Ahzab (Chapter 33), which takes its name from the coalition (ahzab, confederates) that besieged Medina. The surah's engagement with the battle is not merely commemorative -- it is analytical, addressing the psychological and theological dimensions of the siege with considerable precision, and it became the primary framework through which early Muslims understood and processed the experience.

The surah opens its account of the battle (verses 9-27) with a direct address to the believers, calling them to remember God's favor when the armies came against them. The specific detail of verse 10 -- "when they came at you from above you and from below you, and when eyes grew wild and hearts reached the throats, and you harbored various thoughts about God" -- is understood by classical commentators as a description of the moment when the Banu Qurayza's defection became known, creating the possibility of attack from within Medina at the same time as the coalition pressed from outside. The phrase "above and below" is interpreted as describing the coalition approaching from the north (above, toward the mountain terrain) and the Banu Qurayza threat from the south (below, within the city).

Verse 13 records the arguments of those who urged withdrawal: "And when a party of them said, 'O people of Yathrib, there is no stand for you here, so return.' And a group of them asked permission from the Prophet, saying, 'Indeed our homes are exposed,' while they were not exposed; they only wanted to flee." This verse specifically documents the munafiqun's attempt to use the crisis as justification for deserting the defense, and its preservation in the Quran made this episode part of the permanent record of the siege that every subsequent Muslim reader encountered. The verse functions not only as historical documentation but as a framework for understanding what the munafiqun's behavior revealed about the distinction between outward profession and genuine commitment.

The surah's reference to divine assistance -- "We sent against them a wind and forces you did not see" (33:9) -- frames the meteorological events of the siege's final days within a theological claim about divine protection of the community. This framing is not incidental; it connects the Khandaq experience to the broader Quranic pattern of divine intervention on behalf of communities that maintain faith under pressure, placing the siege alongside the narratives of earlier prophets and their communities in the Quran's sustained argument about the relationship between human perseverance and divine response.

The surah then addresses the Banu Qurayza episode directly in verses 26-27, describing God as bringing down those who supported the coalition from their strongholds and casting terror into their hearts, with some being killed and others taken captive. The Quran does not provide narrative detail about the judgment's mechanics -- it presents the outcome as divinely endorsed rather than as a human decision about which further explanation is needed. This framing shaped the Islamic tradition's understanding of the event: the judgment was understood as divinely sanctioned because the Quran itself described the outcome in terms of divine action rather than human decision.

Strategic Consequences and the Road to Hudaybiyyah

The failure of the Ahzab coalition had consequences that reverberated through the Arabian Peninsula over the following two years. The most immediate was the exhaustion of the Quraysh's capacity for direct military action against Medina. The mobilization of ten thousand warriors for the Khandaq campaign had represented the absolute limit of what the Quraysh and their allies could assemble, and the campaign had produced nothing. Another attempt of comparable scale was not politically feasible: the tribal leaders who had committed their forces to the Khandaq campaign and returned empty-handed were not going to repeat the exercise quickly. Abu Sufyan recognized this and shifted his strategy accordingly.

The Ghatafan's experience at Khandaq also shaped their subsequent relationship with the Muslim community. The promised half of Khaybar's date harvest had never been delivered -- the siege had collapsed before any of the campaign's objectives were achieved -- and the tribe had nothing to show for weeks of campaigning in the winter cold. When the Muslim army eventually moved against Khaybar in 628 CE, the Ghatafan tribes were potential enemies who might come to Khaybar's defense. The Prophet's diplomatic approach to the Ghatafan during the Khaybar campaign -- offering them a share of the conquest's proceeds in exchange for neutrality -- reflected the lessons of Khandaq about the Ghatafan's material motivations. The Ghatafan accepted the offer and remained neutral, allowing the Muslim force to reduce Khaybar without the Ghatafan interference that had been one of the Khandaq campaign's theoretical military assets.

The position of Salman al-Farsi within the Muslim community was also transformed by the Khandaq campaign. He had arrived in Medina as a freedman, a convert of foreign origin without tribal affiliations in Arabia's intensely tribal social structure. His proposal of the trench strategy and his participation in its construction -- sources note that the Muhajirun and Ansar competed to claim him as "one of ours," with the Prophet reportedly settling the dispute by declaring that Salman was "of the household of the Prophet" -- gave him a social standing that transcended the normal categories of tribal affiliation. This was not merely an honorific: it reflected a genuine transformation in the community's self-understanding, a recognition that competence, loyalty, and contribution to the community's survival could override the inherited categories of tribal belonging. The principle became more broadly applicable in the subsequent expansion of Islam beyond Arabia.

More broadly, the Battle of Khandaq completed a process that had been underway since Badr: the demonstration that the Muslim community in Medina could not be destroyed by military means. Badr had shown that the Muslims could fight and win against superior numbers in open battle. Uhud had shown that they could absorb significant losses and survive. Khandaq showed that even an unprecedented coalition, assembled at enormous diplomatic and material cost, could not breach their defenses. The three battles together established a fact about the Muslim community's resilience that altered every tribal leader's calculation about their future dealings with Medina.

The Treaty of Hudaybiyyah, concluded in 628 CE, was in many respects the political crystallization of what Khandaq had demonstrated militarily. Abu Sufyan's willingness to negotiate a ten-year peace agreement with the Muslim community -- an agreement that implicitly recognized the Muslim community as a legitimate political entity -- reflected his assessment that the military path to Mecca's goals was closed. The subsequent conquest of Mecca in 630 CE, which occurred without significant fighting and which Abu Sufyan himself eventually facilitated by his own conversion, was the terminal point of a trajectory whose direction had been fixed by the failure of the coalition at the trench in 627 CE.

The Battle of Khandaq thus represents not merely a military engagement but a strategic turning point: the moment at which the question of whether the Muslim community would survive shifted permanently from an open question to a settled fact, and the question of what the Muslim community would become in the Arabian Peninsula began to take over as the primary historical concern. The trench that Salman al-Farsi had proposed and the Muslim community had excavated in six days of winter labor had not merely stopped an army -- it had changed the terms of the struggle entirely.

References and Further Reading

Primary Islamic Sources

  • Quran, Surah Al-Ahzab (33:9–27) — the primary Quranic account of the Battle of the Trench, addressing the trial of the believers and the judgment on the Banu Qurayza
  • Quran, Surah Al-Ahzab (33:9) — "O you who have believed, remember the favor of Allah upon you when armies came to [attack] you and We sent against them a wind and armies [of angels] you did not see"
  • Quran, Surah Al-Ahzab (33:23) — "Among the believers are men true to what they promised Allah" — revealed concerning the companions' steadfastness at the Trench
  • Sahih al-Bukhari, Book of Military Expeditions (Maghazi), Hadith 4101 — detailed account of the Battle of Khandaq including the trench strategy
  • Sahih al-Bukhari, Book of Military Expeditions (Maghazi), Hadith 4104 — on Ali ibn Abi Talib's duel with Amr ibn Abd Wudd at the Trench
  • Sahih Muslim, Book of Jihad and Military Expeditions, Hadith 1769 — on the hardships at the Trench and the Prophet's perseverance
  • Sahih al-Bukhari, Book of Military Expeditions (Maghazi), Hadith 4117 — on the Banu Qurayza and the role of Sa'd ibn Mu'adh as arbitrator
  • Sunan al-Nasa'i, Book of Jihad, Hadith 3175 — on the conditions of the coalition siege and Muslim endurance

Classical Islamic Sources

  • Ibn Hisham, Abd al-Malik. Al-Sirah al-Nabawiyyah. Edited by Mustafa al-Saqqa. Maktabat Mustafa al-Babi al-Halabi, 1955. [Original based on Ibn Ishaq, c. 767 CE]
  • Al-Tabari, Muhammad ibn Jarir. Tarikh al-Rusul wa al-Muluk. Translated by M.V. McDonald. SUNY Press, 1987. [Original c. 915 CE]
  • Al-Waqidi, Muhammad ibn Umar. Kitab al-Maghazi. Edited by Marsden Jones. Oxford University Press, 1966. [Original c. 823 CE]
  • Ibn Sa'd, Muhammad. Al-Tabaqat al-Kubra. Edited by Eduard Sachau. Brill, 1904–1940. [Original c. 845 CE]

Academic and Scholarly Sources

  • Watt, W. Montgomery. Muhammad at Medina. Oxford: Oxford University Press, 1956.
  • Lecker, Michael. Muslims, Jews and Pagans: Studies on Early Islamic Medina. Leiden: Brill, 1995.
  • Donner, Fred M. Muhammad and the Believers: At the Origins of Islam. Cambridge, MA: Harvard University Press, 2010.
  • Rubin, Uri. The Eye of the Beholder: The Life of Muhammad as Viewed by the Early Muslims. Princeton: Darwin Press, 1995.
  • Peters, F.E. Muhammad and the Origins of Islam. Albany: SUNY Press, 1994.

Further Reading

  • Guillaume, Alfred, trans. The Life of Muhammad: A Translation of Ibn Ishaq's Sirat Rasul Allah. Oxford: Oxford University Press, 1955.
  • Lings, Martin. Muhammad: His Life Based on the Earliest Sources. Cambridge: Islamic Texts Society, 1983.
  • Newby, Gordon D. A History of the Jews of Arabia. Columbia: University of South Carolina Press, 1988.
  • Stillman, Norman A. The Jews of Arab Lands: A History and Source Book. Philadelphia: Jewish Publication Society, 1979.