· Travel · 7 min read
What Is the Capital of Morocco? History, Old Capitals, and Why Rabat Reigns
What is the capital of Morocco? Discover Rabat and its fascinating journey from ancient settlement to modern capital. Explore Morocco's imperial cities and the rich history behind the throne.

What Is the Capital of Morocco? The Answer Might Surprise You
If you have ever asked yourself what is the capital of Morocco, you are not alone. Many travelers assume the answer is Marrakech or Casablanca — two cities that dominate Morocco’s international reputation. The actual capital of Morocco is Rabat, a coastal city that often flies under the radar yet carries centuries of history, political significance, and UNESCO-recognized beauty.
Rabat sits on the Atlantic shore where the Bou Regreg River meets the ocean. It is Morocco’s second-largest city and its political and administrative heart. While Marrakech enchants with its souks and Casablanca impresses with its modernity, the Morocco capital offers something different: elegance, calm, and a deep connection to the country’s past.
But Rabat was not always the capital. To understand why this city holds the title today, we need to travel back through the history of Morocco’s shifting seats of power — the storied imperial cities.
Morocco’s Imperial Cities: A History of Shifting Capitals
Morocco is unique in having not one but four imperial cities — Fes, Marrakech, Meknes, and Rabat. Each of these cities has, at some point in history, served as the capital of Morocco. The story of these capitals is the story of the dynasties that shaped the nation.
Fes: The First Great Capital
Founded at the end of the 8th century by Idris I and later expanded by Idris II, Fes is the oldest of Morocco’s imperial cities. Under the Idrisid dynasty, Fes became the political, spiritual, and intellectual capital of the country. It remained the primary seat of power under the Marinid dynasty from the 13th to 15th centuries.
Fes is home to the University of Al Quaraouiyine, the oldest continuously operating university in the world, and its medina — Fes el-Bali — is a UNESCO World Heritage Site and one of the largest car-free urban areas on the planet. For centuries, Fes was the undisputed heart of Morocco.
Marrakech: The Red City Takes the Throne
In the 11th century, power shifted south. The Almoravid dynasty founded Marrakech around 1070 and made it their capital. Later, the Almohads expanded the city into one of the most magnificent capitals in the Islamic world. The iconic Koutoubia Mosque, the impressive city walls, and the lush gardens that still define Marrakech today were built during this golden age.
Marrakech remained a center of power under the Saadian dynasty in the 16th century, who adorned the city with lavish palaces and the famous Saadian Tombs. Even today, Marrakech is often mistakenly thought to be the capital of Morocco because of its global fame.
Meknes: The Versailles of Morocco
Meknes had its moment as capital in the 17th century under Sultan Moulay Ismail of the Alaouite dynasty — the same dynasty that rules Morocco today. Moulay Ismail transformed Meknes into a monumental imperial city with massive walls, grand gates like Bab Mansour, and an enormous royal palace complex. His ambition was to create a Moroccan Versailles, and for a time, Meknes was one of the most impressive capitals in North Africa.
Rabat: From Ancient Settlement to Modern Capital
Long before Rabat became the capital of Morocco, the site was home to ancient civilizations. The Romans established a settlement here called Sala Colonia, and the ruins of Chellah — a medieval necropolis built on Roman foundations — remain one of Rabat’s most evocative sites today.
In the 12th century, the Almohad sultan Yaqub al-Mansur began an ambitious project to build what would have been the largest mosque in the world, crowned by the towering Hassan Tower. Although the project was abandoned after his death, the unfinished minaret still stands as one of Rabat’s most iconic landmarks.
The city’s name, Rabat, derives from “Ribat al-Fath” — the Camp of Victory — a fortress settlement established in the 12th century.
Why Did Rabat Become the Capital?
The turning point came in 1912 with the establishment of the French Protectorate. French General Hubert Lyautey, the first Resident-General, needed a capital that was:
- Strategically located on the coast for easy communication with France
- Politically neutral, positioned between the rival historical capitals of Fes and Marrakech
- Modernizable, with space to build the administrative infrastructure of a colonial government
Rabat checked all three boxes. Lyautey launched an ambitious urban planning project that blended European modernity with traditional Moroccan architecture. Wide boulevards, administrative buildings, and diplomatic quarters transformed Rabat into a functioning modern capital while preserving its historic core.
When Morocco regained independence in 1956, King Mohammed V made the definitive choice: Rabat would remain the capital. The decision honored the continuity of governance and consolidated the country’s national identity around a city that symbolized both tradition and modernity.
In 2012, UNESCO recognized Rabat’s outstanding universal value by designating it a World Heritage Site, citing its harmonious blend of Arab-Islamic heritage and European modernist planning.
What to See in Rabat Today
A visit to the capital of Morocco reveals a city that rewards those who take the time to explore.
Hassan Tower and the Mausoleum of Mohammed V
The Hassan Tower is Rabat’s most recognizable landmark. This unfinished 12th-century minaret rises 44 meters above the esplanade, surrounded by the remnants of hundreds of columns from the uncompleted mosque. Next to it stands the Mausoleum of Mohammed V, a masterpiece of modern Moroccan craftsmanship with its intricate zellige tilework, carved plaster, and gilded cedar ceilings. King Mohammed V, the grandfather of the current king, and his son King Hassan II rest here.
Kasbah of the Udayas
Perched on a cliff overlooking the Atlantic Ocean and the Bou Regreg River, the Kasbah of the Udayas is a fortified citadel dating back to the 12th century. Its narrow, whitewashed streets painted in shades of blue and white make it one of the most photogenic places in Morocco. The Andalusian Gardens inside the kasbah offer a tranquil escape from the city.
Chellah Necropolis
The Chellah ruins lie just outside Rabat’s city walls. This atmospheric site combines Roman remains with an Islamic necropolis built by the Marinids. Storks nest on crumbling minarets, wildflowers grow among ancient stones, and a quiet stillness hangs over the entire complex. It is one of the most hauntingly beautiful places in the capital of Morocco.
The Medina of Rabat
Unlike the chaotic medinas of Fes and Marrakech, Rabat’s medina is compact, clean, and wonderfully walkable. The Rue des Consuls is lined with artisan shops selling Berber carpets, leather goods, and jewelry. The 17th-century Mellah, the former Jewish quarter, adds another layer to the city’s multicultural history.
Mohammed VI Museum of Modern and Contemporary Art
For a different perspective on the capital of Morocco, visit this striking museum, which houses an impressive collection of Moroccan modern and contemporary art. It is a testament to Rabat’s role as a cultural capital as well as a political one.
Why Visit the Capital of Morocco?
Many travelers skip Rabat, rushing instead to Marrakech’s souks or the Sahara’s dunes. But those who make time for the capital of Morocco discover a city that reveals the country’s soul in a quieter, more refined way.
Rabat is a city where history is not locked behind museum glass — it is woven into the streets, the walls, the minarets. It is a place where you can walk from a 12th-century fortress to a 21st-century art gallery in under twenty minutes. It is the seat of government, the home of the royal palace, and yet it remains one of the most relaxed and welcoming cities in the country.
Understanding what is the capital of Morocco means understanding Rabat — and understanding Rabat means understanding the layered, complex story of Morocco itself.
Explore Morocco’s Imperial Cities on a Guided Tour
The best way to appreciate the full story of Morocco’s capitals — past and present — is to visit them. Our 8-Day Imperial Cities and Sahara Desert Tour from Casablanca takes you through Rabat, Meknes, Fes, and Marrakech, combining the history of the imperial cities with the magic of the Sahara Desert. You will walk through ancient medinas, stand beneath the Hassan Tower, cross the dunes of Merzouga by camel, and sleep under a blanket of stars in a luxury desert camp.
Discover the Imperial Cities Tour →
If you prefer to focus entirely on the cities, our 8-Days Tour From Casablanca to Morocco Imperial Cities explores Rabat, Fes, Meknes, Volubilis, and Marrakech in depth, with optional excursions to the High Atlas Mountains or the stunning Ouzoud Waterfalls. It is the perfect itinerary for history lovers.
Frequently Asked Questions
What is the capital of Morocco?
The capital of Morocco is Rabat. Located on the Atlantic coast along the Bou Regreg River, Rabat has been the political and administrative capital since 1912, when the French Protectorate moved the seat of government from Fes and Marrakech.
What was the capital of Morocco before Rabat?
Before Rabat, Morocco had several capitals depending on the ruling dynasty. Fes served as the capital under the Idrisid, Marinid, and early Alaouite dynasties. Marrakech was the capital during the Almoravid and Almohad empires. Meknes briefly served as capital under Sultan Moulay Ismail in the 17th century.
Why did Rabat become the capital of Morocco?
Rabat became the capital in 1912 when French General Lyautey chose it for its strategic coastal location, which made communication with France easier. Its position between the historical power centers of Fes and Marrakech made it a neutral compromise, and its modern infrastructure allowed for efficient colonial administration. Morocco retained Rabat as its capital after gaining independence in 1956.
What are the four imperial cities of Morocco?
Morocco's four imperial cities are Fes, Marrakech, Meknes, and Rabat. Each served as the capital of Morocco at different points in history under various ruling dynasties. Today they are celebrated for their stunning architecture, historic medinas, and deep cultural heritage.
