On March 24, 627 A.D, Abu Sufyan arrived with more than ten thousand men. The Muslims numbered only three thousand.
Quraysh and their allies surrounded Medinah but between the two armies was the long, wide trench.
The Prophet (pbuh) and his men stayed behind this trench for nearly a month defending the city against their more powerful enemy. Many times warriors tried to cross the trench and enter the city, but each time they were pushed back by the Muslims. The Muslims were afraid that if any did manage to cross over, the Jews inside Medinah would join forces with them and the Muslims would be beaten. The Jewish tribe of Bani Quraydhah, who had stood by the, agreement with the Muslims, were pressed by a Jewish emissary from the enemy, to break their promise. Eventually they agreed to do so and when the news of this reached the Prophet (pbuh) and his companions they were greatly troubled. Sa'd ibn Mu'adh, the leader of the tribe of Aws, was sent by the Prophet (pbuh) with two other men to find out if this were true. When they arrived in the part of Medinah where the Jews lived,they found that it was even worse than they had previously thought.
Sa'd ibn Mu'adh, whose tribe was closely allied with the Bani Quraydhah, tried to persuade their leader not to break the treaty with the Muslims, but he refused to listen. This meant that the Muslims could not relax their guard for one moment, for they were now threatened not only by the enemy beyond the trench, but by the Bani Qurayzah, within the walls of the city.
Things became more difficult for the Muslims day by day. It was extremely cold and food began to run out. To make matters worse, the Bani Qurayzah began openly and actively to join forces with the other Jews and cut off all supplies to the Muslims, including food. The enemies of Islam then planned how to capture Medinah.
The situation looked desperate and the Prophet (pbuh) prayed to Allah to help the Muslims defeat their enemies. That very night a sandstorm blew up which buried the tents of Quraysh. The storm continued for three days and three nights making it impossible for the enemy to light a fire to cook a meal or warm themselves by.
On one of these dark nights the Prophet (pbuh) asked one of his men, Hudhayfah Ibn al-Yaman, to go on a dangerous mission. The Prophet (pbuh) told him to make his way across the trench to the enemy camp where he should find out what they were doing. With much difficulty Hudhayfah crossed the trench and made his way to a circle of Quraysh warriors talking in the darkness. He sat near them, but as there was no fire, no one noticed him. He then heard Abu Sufyan's voice: 'Let us go home!' he said. 'We have had enough. The horses and camels are dying, the tents keep blowing away, most of the equipment has been lost, and we can not cook our food. There is no reason to stay!'
Shortly after hearing this Hudhayfah made his way quickly and quietly back across the trench and the next morning the Muslims rejoiced to find that what he had overheard had come true-Quraysh and their allies had gone away!
The siege of Medinah had ended in a great victory for Islam. But this was not to be the end of the difficulties, for the Archangel Gabriel the Prophet (pbuh) and told him that he should punish the Bani Qurayzah for betraying him and the Muslims.
On hearing this, the Prophet (pbuh) ordered the Muslims to march against the Bani Qurayzah as they hid in their fortress. The Muslims besieged them for twenty-five days until they finally gave in. On surrendering, they asked the Prophet (pbuh) to let someone judge their case, and he agreed. He also allowed them to choose who would give the ruling. The man chosen to judge the Bani Qurayzah was Sa'd ibn Mu'adh, leader of the Aws, a tribe which had always protected the Qurayzah in the past. Sa'd ibn Mu'adh who had himself been wounded in the battle, decided that the Jews should be tried by their own Holy Law, according to which anyone who broke a treaty would be put to death. As a result all the men of the Bani Qurayzah were executed and the women and children made captive.
If the Jews had succeeded in their pact, Islam would have been destroyed. Instead from that day on, Medinah became a city where only Muslims lived.
Very soon after peace had been restored to Medinah, Sa'd ibn Mu'adh died of his wounds. It was said that the Archangel Gabriel came in the middle of that night and said to the Prophet (pbuh) '0 Muhammad, who is this dead man? When he arrived, the doors of heaven opened and the Throne of Allah shook.' The Prophet (pbuh) got up as soon as he heard this, but found that Sa'd was already dead. Although he had been a heavy man, the men who carried his body to the grave found it quite light. They were told that the angels were helping them. When he was buried, the Prophet (pbuh) said three times 'Subhan Allah!' (Glory be to Allah!), and 'Allahu Akbar!' (Allah is Most Great!). When asked why he did this, he replied, 'The grave was tight for this good man, until Allah eased it for him.' This is one of the rewards that Allah gives to martyrs and good Muslims.