The Battle of the Trench, also known as Ghazwa Khandaq or the Battle of the Ditch, was a moment of immense strategy, faith, and resilience. In 627 CE (5 AH), during a critical siege of Madinah, the Prophet Muhammad (ﷺ) and his companions defended the city by digging a wide trench—a tactic that changed the course of Arabian warfare.

Today, visitors to Madinah have the unique opportunity to walk through this very terrain. Most travelers visit the site and surrounding landmarks using the city’s Hop-On Hop-Off bus route, which conveniently stops near the Battle of the Trench area. This makes it especially practical for those exploring sacred sites spread across the older quarters of the city while gaining historical context along the way.

Why Visit the Battle of the Trench Site?

Located near Mount Sala’, the original trench encircled the city’s northwestern side, a key vulnerability during that era. Though modern development has covered much of the actual ditch, the area remains a powerful spiritual and historical touchpoint for Muslims around the world.

Visitors walking through the site today can feel a deep connection to the moment when unity, belief, and innovation protected the heart of the Muslim community. It's more than a historical stop—it's a space for reflection and learning.

What Happened at the Battle of the Trench?

In 627 CE (5 AH), Madinah faced a powerful coalition of enemies—over 10,000 men from the Quraysh and various allied tribes. To defend the city, the Prophet Muhammad (ﷺ) accepted a strategic suggestion from Salman Al-Farsi: dig a wide trench along the vulnerable northern front of the city. The tactic—uncommon in Arabian warfare—created a natural barrier that kept enemy forces at bay for nearly a month.

Despite being vastly outnumbered and under siege, the Muslims held their ground with unwavering faith and discipline. Eventually, the coalition forces retreated in defeat, marking a decisive Muslim victory in what became known as the Battle of the Trench (Battle of the Ditch)—a remarkable story of unity, faith, and strategic brilliance. Today, visitors can still explore many of the locations where this iconic event unfolded.

How Many Muslims Fought in the Battle of the Trench?

Historical sources estimate that around 3,000 Muslim fighters participated in the Battle of the Trench. These included the Prophet Muhammad (ﷺ) and his companions, who not only fought but also took part in the physical digging of the trench.

How to Reach the Ghazwa Khandaq Site

One of the most efficient ways to explore this area is by taking the Hop-On Hop-Off Bus, which includes the Battle of the Trench and surrounding sacred landmarks on Route 2 (Green Route).

What Makes This Route Ideal?

  • Direct access to the site: Stops are positioned within walking distance of the trench area and connected mosques.
  • Contextual narration: Onboard commentary enhances understanding as you approach each landmark.
  • Flexibility: You can explore at your own pace, hopping off where you wish and rejoining the loop when ready.

For those unfamiliar with the city layout, this route simplifies the journey while ensuring that key stops aren’t missed.

With that in mind, let’s explore the Battle of the Trench site and the nearby sacred spots in more detail.

The Main Site of the Trench (Al-Khandaq)

📍 Location: Near Mount Sala’ in northwest Madinah
🕋 Significance: The actual site where the Muslims dug the trench during the battle

Although much of the original trench has been covered by urban development, the location remains a sacred reminder of resilience. Visitors can walk along parts of the preserved area, feel the solemn atmosphere, and reflect on the hardship and faith of the Prophet (ﷺ) and his companions.

Ghazwa Khandaq Site, Madinah
💡
Local Insight: Visit early in the morning or just before Maghrib to avoid heat and catch the peaceful serenity of the site.

The Seven Mosques (Saba Masajid)

📍 Located adjacent to the Trench site

Battle of Khandaq Mosque, Madinah

You might be wondering, what is the story of the famous Seven Mosques in Madinah? These small but deeply significant mosques—known locally as Al-Masajid As-Sab’a—are among the most spiritually moving landmarks connected to the Battle of the Trench (Ghazwa Khandaq). Each mosque in this cluster honors a key figure or moment from the siege, making this site an essential stop for anyone seeking a deeper connection to the Seerah and the legacy of the Prophet (ﷺ) and his companions.

This powerful collection of sacred spaces is located just a short walk from a main Hop-On Hop-Off bus stop, making it easily accessible for those following Route 2 (Green Route).

1. Masjid Al-Fath

This is the largest and most prominent mosque among the seven. It is believed to mark the spot where the Prophet Muhammad (ﷺ) prayed fervently for victory during the Battle of the Trench. “Al-Fath” means “The Victory,” and the mosque stands as a symbol of divine support and answered prayers during times of hardship. The mosque offers sweeping views of the surrounding area, providing both spiritual and visual inspiration.

Masjid Al-Fath, Madinah

2. Masjid Salman Al-Farsi

Named after Salman Al-Farsi, the companion whose strategic idea to dig a trench revolutionized the defense of Madinah. This mosque honors his pivotal role in Islamic military history and his intellectual contribution to the victory. It’s a beautiful reminder of how knowledge and wisdom can turn the tide in moments of crisis.

Masjid Salman Al-Farsi, Madinah

3. Masjid Abu Bakr

This smaller mosque pays tribute to Abu Bakr As-Siddiq, the Prophet’s closest companion and the first caliph after his passing. Abu Bakr played a key role in supporting the Prophet (ﷺ) during battles and was known for his unwavering faith. The mosque serves as a marker of his physical and spiritual presence during the time of the trench.

Masjid Abu Bakr, Madinah

4. Masjid Umar

Dedicated to Umar ibn Al-Khattab, the second caliph and a fearless leader known for his strength, justice, and commitment to Islam. Masjid Umar commemorates his involvement in the Battle of Khandaq and highlights his leadership in defending the Muslim community.

Masjid Umar, Madinah

5. Masjid Ali

This mosque honors Ali ibn Abi Talib, cousin and son-in-law of the Prophet (ﷺ), and a celebrated warrior during Islamic battles. His bravery and loyalty were instrumental during the siege. Masjid Ali stands as a tribute to his courage and closeness to the Prophet (ﷺ).

Masjid Ali, Madinah

6. Masjid Sa’d ibn Mu’adh

Sa’d ibn Mu’adh, the chief of the Aws tribe, was a key figure in defending Madinah. He was critically wounded by an arrow during the battle and later died from his injuries, becoming one of the battle’s most honored martyrs. This mosque marks his place of contribution and sacrifice.

7. Masjid Fatimah

Though not always included in every historical list, many recognize Masjid Fatimah as the seventh mosque. It is dedicated to Fatimah Az-Zahra, the beloved daughter of the Prophet (ﷺ). Her inclusion among the Seven Mosques reflects the familial strength and presence of the Prophet’s household during the testing times of war.

Masjid Fatima, Madinah

Masjid Bani Haram and the Cave of Bani Haram

📍 West of Mount Sala’

Masjid Bani Haram, Madinah

This mosque is believed to be one of the places where the Prophet (ﷺ) prayed during the trench-digging period. Nearby lies the Cave of Bani Haram, where he reportedly sought rest during the battle’s preparation. It's easily reached as part of the same outing when stopping at the trench site via the bus route.

Cave of Bani Haram, Madinah

Why Visit:

  • Reflect on the Prophet’s moments of solitude and connection with Allah during one of the most intense battles.
  • A quiet spot for personal du’a and contemplation.

Masjid Al-Mustarah (Bani Harithah Mosque)

📍 Along Sayyid al-Shuhada Street

Masjid Al-Mustarah, Madinah

Known as the “Mosque of Rest”, this mosque marks the place where the Prophet (ﷺ) and his companions stopped to rest on their return from the Battle of Uhud. Though not directly tied to the trench battle, it’s a poignant reminder of the Prophet’s physical and emotional burden during times of war.

🧠
Did you know? You can easily visit Mount Uhud via the Red Route’s Uhud Stop using the Hop-On Hop-Off bus, and pair it with a short walk to nearby Masjid Al-Mustarah as part of your ziyarat experience.

Al-Rayah Mosque (Masjid al-Rayah / Masjid Dzubab)

📍 On Mount Dzubab

This lesser-known mosque sits atop a hill believed to have been used as a command post during the Battle of Khandaq. The name “Al-Rayah” means “flag”, referring to the Prophet’s banner during the battle. For those exploring via the bus route, this stop breaks up the itinerary beautifully between walking and seated reflection.

Al-Rayah Mosque, Madinah
💡
Travel Tip: It’s a bit of a climb, but the view of Madinah from here is spectacular—perfect for reflection and photography.

Jabal Ayr

📍 South of Madinah

Jabal Ayr, Madinah
Madinah City View from Jabal Ayr

Though not directly part of the battlefield, Jabal Ayr is the second-largest mountain in Madinah after Mount Uhud and forms a key element of the city’s strategic geography. During the time of the Battle of the Trench, it is believed to have served as a vital watch point for monitoring enemy movements.

Battle of the Trench: Travel Tips

  • Best Time to Visit: Early morning or after Asr to avoid midday heat.
  • Modest Dress: These are sacred spaces—dress appropriately and respectfully.
  • Bring Water & Snacks: Especially if you plan to walk between sites.
  • Charge Your Devices: Phones, cameras, or audio guides may be useful.
  • Use Route 2 (Green): The Hop-On Hop-Off bus offers easy access.

A Journey Through Madinah’s Living History

Standing at the site of the Battle of the Trench, you’re not just looking at earth and stone—you’re witnessing a place where divine strategy met unshakeable faith. And with thoughtful city planning and accessible transport like the Hop-On Hop-Off Bus, experiencing this history has never been more seamless. Whether it’s your first ziyarat or your tenth, revisiting the sites tied to Ghazwa Khandaq offers new lessons and reflections each time.

Walk with purpose, pause with gratitude, and let the city’s sacred echoes speak to your soul.