The Battle of the Trench (known as Khandaq) took place in the 5th year of the Hijri calendar. A massive army of 24,000 soldiers, made up of the Quraish tribe and Jewish tribes, joined forces to attack the city of Madinah.
Seeing this danger, Prophet Muhammad (peace be upon him) called his companions (Sahabah) together to discuss a plan. Many people offered different suggestions on how to face the oncoming enemy.
A companion named Salman al-Farsi (may Allah be pleased with him), who came from Persia, suggested digging a large trench (a deep ditch) around the city. Digging trenches to weaken enemies was a common battle strategy used by the Persians.
Following Salman al-Farsi’s advice, the Prophet (pbuh) arranged to dig a trench around Madinah. Since three sides of the city were already protected by buildings, gardens, and small hills acting like natural walls, they only needed to protect the fourth side. This fourth side faced the region of Sham (Syria) and was wide open.
The Prophet (pbuh) went to this open area with 3,000 companions and marked the exact lines where they needed to dig. His command was for groups of ten men to work together to dig a section that was 20 cubits wide and 10 cubits deep.
After giving the orders, the Prophet (pbuh) also joined in the hard work. He helped carry away the dug-up soil and sometimes dug the ground himself.
The Test of Hunger and a Miracle
During this work, the Prophet (pbuh) and his companions had to go without food for three consecutive days.
In Arab tradition, when working under extreme hunger, people would tie stones tightly against their stomachs to help keep their backs straight. The companions did exactly this while working.
Some of the companions, unable to bear the intense hunger, came to the Prophet (pbuh) and lifted their shirts to show their stomachs.
Each of them had a stone tied to it. Seeing this, the Prophet (pbuh) lifted his own upper garment—and revealed that he had two stones tied to his stomach.
It was during this difficult time that an amazing miracle took place. The companion Anas (may Allah be pleased with him) narrates the story:
“I saw the Prophet (pbuh) with stones tied to his stomach out of extreme hunger. I immediately went home and told my father about his condition.
Hearing this, my father went out, bought a little wheat, and my mother ground it into flour to make a single piece of bread. This food was only enough to satisfy the Prophet’s hunger alone. If anyone else came along, there wouldn’t be enough food for them.
My parents told me, ‘Go find the Prophet when he is alone, tell him about the food, and invite only him to come and eat.'”
Anas continues:
“When I went there, the Prophet (pbuh) was surrounded by a large crowd. I stood there hesitating. The Prophet looked at me and asked, ‘Anas! Did your father send you?’ I said, ‘Yes.’ He asked, ‘To invite me for food?’ I replied, ‘Yes.’
Immediately, the Prophet turned to the crowd and shouted, ‘Everyone, let’s go to Abu Talha’s house! There is a feast for all of us today!’ and he stood up.
I ran back home in fear and told my father, ‘The Prophet is bringing a whole crowd with him!’ My father calmly replied, ‘Allah and His Messenger know best.'”
When the Prophet (pbuh) arrived with the large group of companions, Anas’s father welcomed them inside. There was only one piece of bread and a small container with a little ghee (clarified butter).
When the ghee container was turned over onto the bread, only a few drops fell. The Prophet (pbuh) touched the bread with his blessed hands and spread the drops. Miraculously, the bread began to grow and multiply in size! He placed it before everyone, said “Bismillah” (In the name of God), and prayed, “O Allah! Increase the blessings in this food.”
The companions sat down in groups of ten and ate. Everyone ate until they were completely full.
The Miracle of the Large Rock
After eating, they returned to digging the trench. While working, the companions hit a massive rock that was blocking their way. They tried their best to break it, but failed. They asked the Prophet (pbuh) for permission to bypass it and dig around it.
Instead, the Prophet (pbuh) walked over to the rock, took a sledgehammer from a companion, and climbed down into the trench. He looked at the rock and struck it hard with the hammer. The rock cracked, and a bright light flashed from the crack.
Seeing this, the Prophet (pbuh) declared, “Allahu Akbar (God is the Greatest)! I have been given the keys to the region of Sham (Syria)!” The companions also shouted “Allahu Akbar!” along with him.
He struck the rock a second time. It cracked even wider, and another flash of light appeared. The Prophet (pbuh) said, “Allahu Akbar! I have been given the keys to the Persian Empire (Iran and Iraq)!”
He struck the rock a third time. The rock broke completely, and a third light shone. The Prophet (pbuh) said, “I have been given the keys to the land of Yemen!”
He then explained the miraculous visions he had just seen:
- First, he was shown the palace of the Roman Emperor (Caesar) in the region of Sham.
- Second, he was shown the palace of the Persian King (Chosroes) in the city of Madain.
- Third, he was shown the palace of San’a, the capital city of Yemen.
Right after this, the Angel Jibril (Gabriel) appeared and confirmed, “You will surely conquer these lands.”
Conclusion
At a time of extreme trial—when a massive army of 24,000 men was marching to destroy them—the Prophet (pbuh) gave the Muslims the good news that three of the greatest empires of the world would become Muslim lands. Even today, these regions remain Islamic nations.
This history teaches us that after every severe hardship, victory is waiting. The key is not to give up during the trial, but to face it with courage. Islam teaches us the mindset to turn our struggles into great achievements.
