The Invasion of Banu Qurayza took place in Dhul Qa‘dah during January of 627 CE (5 AH) and followed on from the Battle of the Trench.  

The Banu Qurayza, a Jewish tribe that once lived in Medina, though allied with the Muslims and even lent them equipment to dig the trench during the Battle of the Trench, refused to fight in the battle as they were offended by Muhammad's attacks on Jews. Waqidi claims that Muhammad had a treaty with the tribe which was torn apart. Norman Stillman and Watt believe such a treaty was "doubtful" to have existed, though Watt believes the Qurayza had agreed not to assist Muhammad's enemies against him. According to Safiur Rahman Mubarakpuri, Peters, Stillman, Guillaume, Inamdar and Ibn Kathir, on the day of the Meccans' withdrawal Muhammad led his forces against Banu Qurayza. According to Muslim tradition he had been ordered to do so by God.

The Banu Qurayza were besieged for 25 days until they surrendered. The men from Banu Aws, who were one of the two Arab tribes in Medina who had become followers of Muhammad and part of the Ansar, requested that Muhammad treat Banu Qurayza leniently, as they were their client tribe. Muhammad then proposed that one man from the Banu Aws pass the judgment, and they agreed. He then appointed Sa'd ibn Muadh, who was gravely wounded by an arrow. So Sa'd stated that his decision would be, "The men should be killed, the property divided, and the women and children taken as slaves." Muhammad approved of the ruling, calling it in accordance with God's decree pronounced above the seventh heaven. After that, nearly all male members of the tribe who had reached puberty were beheaded. The Muslim jurist Tabari quotes 600–900 being killed. The Sunni hadith do not give the number killed, but state that all pubescent males were killed and one woman. According to Ibn Kathir, Quranic verses 33:26-27 and 33:9-10 are about the attack against the Banu Qurayza.

Banu Qurayza

The Banu Qurayza ( alternate spellings include Quraiza, Qurayzah, Quraytha, and the archaic Koreiza) were a Jewish tribe that lived in northern Arabia, at the oasis of Yathrib (known today as Medina).

Jewish tribes reportedly arrived in Hijaz in the wake of the Jewish-Roman wars and might have introduced agriculture, which may have put them in a culturally, economically and politically dominant position. The Banu Qurayza, however, did not own any land.

Background

Agreement with Muhammad
The Banu Qurayza reportedly signed a treaty with Muhammad. According to Watt it is unclear whether or not their treaty with Muhammad, obliged the Qurayza to help him defend Medina or merely to remain neutral; according to Ramadan, they had signed an agreement of mutual assistance with Muhammad. This stance is supported by medieval sources Ibn Ishaq/Ibn Hisham and al-Waqidi. Both Watt and Stillman believe that no special agreement existed between Muhammad and the Qurayza. Watt, however, does agree that the Qurayza had agreed not to support Muhammad's enemies against him. Zafar Ali Qureshi, has criticized Watt's assessment and approach to such incidents.

In 627, Abu Sufyan, led an attack on Medina during the Battle of the Trench. The Qurayza did not participate in the fighting - according to David Norcliffe, but they lent tools to the Muslims, to defend themselves in Medina. The Qurayza were deeply offended by Muhammad's recitation of revelations which criticized some Jews. According to Al-Waqidi, the Banu Qurayza helped the defense effort of Medina by supplying spades, picks, and baskets for the excavation of the defensive trench the defenders of Medina had dug in preparation.  According to Watt, the Banu Qurayza "seem to have tried to remain neutral" in the battle but later changed their attitude when a Jew from Khaybar persuaded them that Muhammad was sure to be overwhelmed, making them doubt whether they should help and ally with Muhammad and though they did not commit any act overtly hostile to Muhammad, according to Watt, they entered into negotiations with the invading army to reach a settlement.  Musnad Ahmad ibn Hanbal no. 22823 also mentions that the Qurayza allegedly helped Muhammad by turning down Abu Sufyan when he wanted their help to attack Muhammad, and that Abu Sufyan was not happy with them.

According to Shibli Nomani, Ibn Ishaq writes that during the siege, the Qurayza readmitted Huyayy ibn Akhtab, the chief of the Banu Nadir whom Muhammad had exiled (during the Invasion of Banu Nadir),

Alleged decision to terminate alliance 
Al-Waqidi reports that Huyayy tore into pieces the agreement between Ka'b and Muhammad. Rumours began to spread that the Qurayza had decided to terminate their treaty with Muhammad. So Muhammad sent some men to confirm this. According to William Muir, the Qurayza said to the men "Who is Mahomet, and who is the Apostle of God, that we should obey him? There is no bond or compact between us and him." Norman Stillman denies the claims of al-Waqidi and that there ever was an agreement. Watt also rejects the existence of such a special agreement, but notes that the Qurayza had a general agreement with Muhammad because they were allied to 2 Muslim tribes (the Banu Aws and Banu Khazraj).

Reason for attack
According to Peters and Stillman, on the day of the Meccans' withdrawal, Muhammad led his forces against the Banu Qurayza neighborhood. According to the Muslim tradition, he had been ordered to do so by the angel Gabriel.

According to The Sealed Nectar, a modern Islamic biography of Muhammad written by the Indian Muslim author Saif ur-Rahman Mubarakpuri, the Angel Gabriel visited Muhammad while he was washing clothes at Umm Salama’s house, asking that he should unsheathe his sword and go to the Banu Qurayza and fight them. Mubarakpuri claims Gabriel said that he, with a procession of angels, would go ahead to the fort of the Banu Qurayza and cast fear in their hearts. This is also mentioned in the Sunni hadith collections in .

Ibn Kathir, mentioned the sequence of events in his Tafsir, as follows:

Muhammad immediately summoned the prayer caller and ordered him to announce fresh hostilities against the Banu Qurayza, instituted Ibn Umm Maktum as a ruler of Medina, and entrusted the banner of war to ‘Ali bin Abi Talib, who marched towards the appointed target and came close enough to hear the Banu Qurayza abusing Muhammad, who on his part set out at the head of 3,000 infantry men and 30 horsemen of Ansar (Helpers) and Muhajireen (Emigrants).

Siege of Banu Qurayza
When they reached the habitations of Banu Quraiza, they laid tight siege to their forts. The Banu Qurayza retreated into their stronghold and endured the siege for 25 days. As their morale waned, Ka'b ibn Asad (the chief of the tribe) suggested three alternative ways out of their predicament: embrace Islam, kill their own children and women, then rush out for a charge to either win or die; or make a surprise attack on the Sabbath. The Banu Qurayza accepted none of these alternatives. Instead they asked to confer with Abu Lubaba, one of their allies from the Aws. According to Ibn Ishaq, Abu Lubaba felt pity for the women and children of the tribe who were crying and when asked whether the Qurayza should surrender to Muhammad, advised them to do so. However he also "made a sign with his hand toward his throat, indicating that [their fate] would be slaughter". According to Mubarakpuri, Abu Lubab begged Muhammad for forgiveness (on behalf of the Qurayza), but Muhammad said it is only God who can forgive him. The next morning, the Banu Qurayza surrendered and the Muslims seized their stronghold and their stores. The men - numbering between 400 and 900 - were bound and placed under the custody of Muhammad ibn Maslamah, who had killed Ka'b ibn al-Ashraf, while the women and children - numbering about 1,000 - were placed under Abdullah ibn Sallam, a former rabbi who had converted to Islam.

According to Mubrakpuri, Muslims continued their siege for many days and were getting tired. Ali and Zubayr ibn al-Awwam proceeded with ‘Ali swearing that he would never stop until he had either stormed their garrisons or been martyred like Hamza.

Muhammad meanwhile asked one of his poets, Hasam bin Thabit to abuse them with his poems. This is mentioned in

Massacre of Banu Qurayza

Surrender and execution

After their garrisons were stormed by Ali they had no choice but to comply with Muhammad's judgement. Muhammad ordered that the men should be handcuffed, and this was done under the supervision of Muhammad bin Salamah Al-Ansari while the women and children were isolated in confinement. Thereupon Al-Aws tribe interceded begging Muhammad to be lenient towards them. He suggested that Sa‘d bin Mu‘adh, a Muslim convert who was a former ally of the tribe, should decide their fate.

According to Mubrakpuri, Stillman, Peters and Adil and Muir, when Sa'd arrived, his fellow Aws pleaded for leniency towards the Qurayza and on his request pledged that they would abide by his decision. He then pronounced that "the men should be killed, the property divided, and the women and children taken as captives". Muhammad approved of the ruling, calling it similar to God's judgment. Mubarakpuri states that the tribesmen who reached puberty were beheaded.
 
Martin Lings, in his book "Muhammad: his life based on the earliest sources", page 231 and 232 said :
Sa‘d was a man of mighty stature, of handsome and majestic appearance, and when he came to the camp the Prophet said "Rise in honour of your liege lord," and they rose to greet him saying: "Father of ‘Amr, the Messenger of God hath appointed thee to judge the case of thy confederates." He said: "Do ye then swear by God and make by Him your covenant that my judgement shall be the verdict upon them?" "We do," they answered. "And is it binding upon him who is here?" he added, with a glance in the direction of the Prophet, but not mentioning him out of reverence. "It is," said the Prophet. "Then I judge," said Sa‘d, "that the men shall be slain, the property divided, and the women and children made captive."1 The Prophet said to him: "Thou hast judged with the judgement of God from above the seven heavens."
Lings added the footnote 1 at the bottom of the page 232 
1 Sa‘d's judgment was no doubt directed mainly against their treachery; but in fact it coincided exactly with Jewish law as regards the treatment of a besieged city, even if it were innocent of treachery: When the Lord thy God hath delivered it unto thy hands, thou shalt smite every male therein with the edge of the sword: but the women, and the little ones, and the cattle, and all that is in the city, even all the spoil thereof, shalt thou take unto thyself. Deuteronomy 20: 12.
- Daniel C. Peterson, in his book “Muhammad, Prophet of God”, page 127, said :
After receiving promises from all the Muslims present that they would indeed abide by his judgment, Sa‘d decreed the execution of the men of Banu Qurayza, the enslaving of their women and children, and the division of their property among the muslims.5 “You have judged,” said the Prophet, “with the judgment of God from above the seven heavens.”6
Daniel C. Peterson added the footnote 6 at the bottom of the page 127
Perhaps with some apologetic intent, the late English scholar Martin Lings notes, correctly, that Sa'd judgment accords with that of the law of Moses as recorded in Deut. 20:10:14. See Lings, p. 232 n.1.
Sa'd dismissed the pleas of the Aws, according to Watt because being close to death and concerned with his afterlife, he put what he considered "his duty to God and the Muslim community" before tribal allegiance. Tariq Ramadan argues that Muhammad deviated from his earlier, more lenient treatment of prisoners as this was seen "as sign of weakness if not madness" and Peterson concurs that the Muslims wanted to deter future treachery by severe punishment.

This is also mentioned in the Sunni hadith collections, stating:

A large arsenal of the Banu Qurayza which consisted of 1500 swords, 2000 spears, 300 armours and 500 shields, were confiscated by Muhammad. Trenches were dug in the bazaar of Madinah and a number of Jews between six and seven hundred were beheaded therein.

Huyai, a chief of Bani Nadir and Safiyah’s father, had joined the ranks of Banu Quraiza when Quraish and Ghatfan defected, was admitted into the audience of Muhammad with his hands tied to his neck with a rope. In audacious defiance, he declared obstinate enmity to Muhammad. He was ordered to sit down, and was beheaded on the spot.

According to Mubrakpuri, only one woman of the Jews was killed because she had killed a Muslim warrior by flinging a grinding stone upon him. This is also mentioned in Sunni Hadith collections:

A few elements of the enemy embraced Islam and their lives, wealth and children were spared. As for the spoils of the war, Muhammad divided them. Women captives were sent to Najd to be exchanged with horses and weaponry. In the process of the siege laid to Banu Quraiza, one man of the Muslims, Khallad bin Suwaid was killed when a woman of the Jews dropped the grinding stone on him, and another, Abu Sinan bin Mihsan, the brother of ‘Ukasha, died. The siege of Banu Quraiza’s forts lasted for 25 days.

Executors
Several accounts note Muhammad's companions as executioners, Ali and al-Zubayr in particular, and that each clan of the Aws was also charged with killing a group of Qurayza men. Subhash Inamdar argues that this was done in order to avoid the risk of further conflicts between Muhammad and the Aws. According to Inamdar, Muhammad wanted to distance himself from the events and, had he been involved, would have risked alienating some of the Aws. the Banu Aws were allied to the Banu Qurayza and Muhammad.

Islamic primary sources

According to Meir J. Kister, all male members of the tribe who reached puberty were beheaded. Ibn Kathir says those who did not reach adolescence were taken prisoners instead of being killed.

Quran
According to the 14th century commentator Ibn Kathir, the event is referenced in the Quran:

Ibn Kathir's commentary of the verse in his Tafsir is as follows:

According to Ibn Kathir, Quran 33:09 and 33:10 is also related to the Banu Qurayza.

Hadith literature
In the Sunni hadith collection Abu Dawud:

According to Mubrakpuri, Peters, Stillman, Guillaume and Inamdar, Islamic tradition says that the angel Gabriel and Muhammad spoke to one another before the attack. This is also mentioned in the Sunni hadith collection Sahih Bukhari:
 
The event is also mentioned in , , , ,  and many others.

Biographical literature
The early Muslim jurist Tabari and Ibn Hisham also mention this event stating 600-900 were killed. Tabari's account is as follows:

See also
 List of battles of Muhammad
 Military career of Muhammad
 Muslim–Quraysh War

References

Sources
Peters, Francis E., Muhammad and the Origins of Islam. State University of New York Press, 1994. .
. Note: This is the free version available on Google Books
Encyclopaedia of Islam. Ed. P. Bearman et al., Leiden: Brill, 1960-2005.
Encyclopedia Judaica (CD-ROM Edition Version 1.0). Ed. Cecil Roth. Keter Publishing House, 1997. 
Kister, Meir J., "The Massacre of the Banu Quraiza. A re-examination of a tradition", in: Jerusalem Studies in Arabic and Islam 8 (1986).
Stillman, Norman. The Jews of Arab Lands: A History and Source Book. Philadelphia: Jewish Publication Society of America, 1979. 

Nomani, Shibli, Sirat al-Nabi. Karachi: Pakistan Historical Society, 1970.
Norcliffe, David, Islam: Faith and Practice. Sussex Academic Press, 1999.

627
Campaigns led by Muhammad
Banu Qurayza
Islam and Judaism
Muhammad in Medina
Muhammad and Judaism
Massacres of men
Islam and violence
Jewish military history
Violence against men in Asia
Massacres of Jews