Skip to content
The blue and white lanes of the Kasbah des Oudayas above the mouth of the Bou Regreg in Rabat

Routes

Marrakech to Rabat: Distance, Train and Which Station

Rabat–Marrakech distance is 320 km. The train takes about four hours and there are two Rabat stations — get off at the wrong one and you lose an hour.

Distance

320 km

Real driving time

4h

Google Maps says

3h 20

  • Train (ONCF)
  • Private car
  • Bus (CTM / Supratours)

Updated 5 August 2026

Rabat–Marrakech distance: 320 km, and the train is the answer. About four hours, direct, comfortable, several times a day. The only thing worth memorising is that Rabat has two stations and the first one the train reaches is probably not yours.

Rabat–Marrakech distance and the fastest way to cover it

Marrakech–Rabat distance: 320 km by road. Distance Marrakech–Rabat, distance Rabat–Marrakech, it is the same 320 km either way, because everything between the two cities funnels through the Casablanca corridor — there is no direct road, no shortcut, and no reason to want one.

Time Cost Verdict
Train (ONCF) ~4h Cheap Direct, comfortable, what we recommend
Private car 4h door to door Highest Only if you are stopping or arriving oddly
Self-drive 3h 30 – 4h Middle Fine, but you will pay tolls to sit on a motorway
CTM coach ~5h Cheapest An hour longer for a small saving

The train from Marrakech to Rabat

The Marrakech to Rabat train runs through the day and most services are direct — you stay in your seat through Casablanca. Journey time is about four hours, sometimes four and a half. Timetables list it as Marrakech to Rabat Agdal and Rabat Ville, so a search for train Marrakech to Rabat will show both stops on the same service.

First class buys a reserved seat in an air-conditioned compartment and is worth the small supplement over four hours. Second class is cheaper and can be crowded on Friday afternoons and around holidays. Tickets go on sale at the station, at platform machines and on the ONCF site; fares change, so check the day’s price.

Marrakech station is on Avenue Hassan II in Gueliz, about 3 km from Jemaa el-Fna — ten to fifteen minutes in a metered petit taxi from the medina.

Rabat Ville or Rabat Agdal? The station that matters

This is the practical trap on this route and it catches people every week.

Rabat has two main stations, and trains from Marrakech reach Rabat Agdal first. Agdal sits about 3 km southwest of the centre in the ministries-and-offices district. If you get off there because it is the first stop with “Rabat” in the name, you have a taxi ride ahead of you.

Rabat Ville is the one you want for the medina, the Kasbah des Oudayas, the Hassan Tower and almost every hotel a visitor books. It is in the centre, on Avenue Mohammed V, and you can walk to the old town in about ten minutes.

One exception: Al Boraq, the high-speed line to Tangier, uses Rabat Agdal only. So if you are arriving from Marrakech and continuing north the next morning, Agdal may genuinely be your station. Decide before you board, not when the doors open.

Driving the A7 and A3

If you drive from Marrakech to Rabat, the route is motorway the whole way: the A7 north to Casablanca, the Casablanca bypass, then the A3 up to Rabat.

Google Maps says 3h 20. We log four hours door to door, and the gap is entirely the Casablanca ring road — the busiest stretch of road in Morocco, and unavoidable in either direction. On a Friday afternoon or a Sunday evening add another half hour and do not be surprised.

Tolls for the full run come to roughly 120 MAD for a car at the time of writing, paid at barriers. Fuel and service areas are frequent on this corridor, unlike almost everywhere else in the country.

The road itself is good and dull. There is nothing to see between the two cities that justifies driving rather than reading on the train, which is the same conclusion we reach on the Casablanca to Marrakech leg.

Is Rabat worth stopping for?

Honestly: half a day, yes. Three days, no.

Most visitors skip Rabat and most of them are not wrong to — it is the administrative capital, it is calm, well swept and slightly formal, and it does not have the density of Fes or the noise of Marrakech. Nobody comes to Morocco for Rabat.

But two things in it are genuinely first-rate.

The Kasbah des Oudayas is a small blue-and-white walled quarter on the cliff above the mouth of the Bou Regreg, with an Andalusian garden inside it and the Atlantic below. It is what people imagine Chefchaouen will feel like, without the crowd.

The Chellah is better still: a Roman town with a Merinid necropolis built on top of it, walls, ruined minarets, fig trees growing out of the stonework and storks nesting on everything. It is quiet, strange and mostly empty.

Add the Hassan Tower and the medina and you have a comfortable half day. That is the case for stopping, and it is an honest one.

Marrakech → Rabat → Tangier over two days

This is where Rabat earns its place in an itinerary rather than as a destination.

Take the morning train from Marrakech, arrive early afternoon, spend the rest of the day on the Oudayas and the Chellah, sleep in Rabat. Next morning, walk or taxi to Rabat Agdal and take Al Boraq to Tangier — about an hour and twenty minutes on the high-speed line.

That splits an otherwise punishing north-bound day into two civilised halves and gives you a city most people never see. It is the logic behind the Rabat night in our seven-day imperial cities itinerary.

Going back: Rabat to Marrakech

The Rabat to Marrakech train runs on the same pattern in reverse, roughly hourly through the middle of the day. Board at Rabat Ville rather than Agdal if you are coming from the medina; both work, but Ville is where you already are. There is no separate southbound service to hunt for — the Rabat–Marrakech train is the same rolling stock going the other way, and the train Rabat–Marrakech takes the same four hours it took coming up.

If you are heading south afterwards — Essaouira, the Tichka, the desert — the railway ends at Marrakech and everything beyond it is road. Getting around Morocco sets out where that line falls and what it means for planning.

So which do you take?

  • Nearly everyone — the train, direct, four hours, and get off at Rabat Ville.
  • Continuing to Tangier the next day — the train, and consider staying near Agdal for the morning departure.
  • Arriving late or with a lot of luggage — a private car, and we will tell you plainly that it is the more expensive way to cover a motorway.
  • Trying to save money — second class on the train still beats the coach on time and comfort.

Rabat is a good hinge between the south and the north, and the stages either side of it are where planning actually pays. Tell us your route and we will build it around the trains where the trains are better.

Frequently asked questions

How far is Rabat from Marrakech?

320 km by road, north through Casablanca. There is no shorter route — everything between the two cities funnels through the Casablanca corridor.

How long is the train from Marrakech to Rabat?

About four hours, sometimes four and a half depending on the service. Trains run through the day and most are direct, so you do not have to change at Casablanca.

Which Rabat station should I get off at?

Rabat Ville if you are staying in the medina, the Kasbah des Oudayas or the centre — it is a ten-minute walk from most of what you came for. Rabat Agdal is 3 km southwest in the business district and is the station Al Boraq uses. Trains from Marrakech call at Agdal first, so do not get up at the first announcement.

Is there a direct train from Marrakech to Rabat?

Yes. Most services run through without a change, and the ones that do not connect at Casa Voyageurs with a short wait on the same platform level. Check the ONCF timetable on the day.

How long does it take to drive from Marrakech to Rabat?

Google Maps says 3h 20 for the 320 km. We log four hours door to door, and more on a Friday afternoon, because the Casablanca ring road is the bottleneck and there is no way round it.

Is Rabat worth visiting?

For half a day, genuinely yes. The Kasbah des Oudayas above the river mouth and the Chellah, a Roman site with a Merinid necropolis grown through with fig trees and storks, are both first-rate and neither is crowded. As a place to spend three days, most visitors would rather be in Fes.

How do I get from Rabat to Tangier?

Al Boraq, the high-speed train, from Rabat Agdal. About an hour and twenty minutes. This is why Rabat is a sensible overnight stop when you are working your way north from Marrakech.

Is there a bus from Marrakech to Rabat?

Yes, CTM and others run it in around five hours. It costs a little less than the train and takes an hour longer on a route where the train is direct and comfortable. We would not.

Both ends of this route

Let's plan your Morocco trip

Tell us your dates and interests. We reply personally, usually within a couple of hours.

usually within 2 hoursNo deposit to planLicensed tour guide

+212 670 162 180