National Railways Office (ONCF; from French: Office National des Chemins de Fer; ; al-Maktab al-Waá¹Âaniyy li-s-Sikak al-Ḥadëdiyyah) is the national railway operator of Morocco. It is a state-owned enterprise under the supervision of the Ministry of Transport and Logistics, responsible for passenger and freight transport on the national rail network, as well as for the construction, operation, and maintenance of railway infrastructure.
As of 2025, ONCF employs 6,696 people and operates a railway network of 2,295 km of lines and 3,848 km of track, all built to standard gauge. Of this network, 64% of the lines are electrified.
The current Director General of ONCF is Mohamed Rabie Khlie, who has held the position since 2005. The organisation is headquartered in Rabat.
The railways have been state-owned since the formation of ONCF, created in 1963 as a merger of various private companies:
ONCF performs several operations and has as a mission to:
ONCF has undergone several institutional reforms before becoming a state-owned company. Further institutional reforms are expected in order to open the national railway market to competition. Plans were made in 2007 to re-form it into a limited company fully owned by the Moroccan State to be called SMCF (French: Société Marocaine des Chemins de Fer) but this hasn't materialized by the planned deadline in 2012.
The network has a northâÂÂsouth track from Tangier via Rabat and Casablanca to Marrakesh. This line connects all major cities along or close to the Atlantic coast. In September 2012, ONCF started upgrading the Casablanca-Kenitra main line to improve capacity.
The other main link is the Northern East to West link from Oujda via Fez and Meknes to Rabat connecting to the N-S tracks in Kenitra.
For the (main) destinations where there is no train service (yet) the ONCF operates their own bus company Supratours offering connecting bus services from the nearest railway station to places like Agadir, Tétouan or Essaouira
A major investment program upgrades and extends the network. In 2009, a branch-line of the E-W link was completed, running from Taourirt for 100 km to Nador. This track runs down from the Rif mountains to sealevel at Nador. Most of the route from Taourirt follows the same route as the National Road 19. The tracks through Nador are underground and after Nador Ville the track continues to the Nador Port in Bin Anà ÂÃÂr above ground again. This new branch-line is used for both passenger and freight trains with several passenger trains serving Fez, Rabat to Casablanca or to Tangier. There are 6 trains per day: some demanding change at Taourirt wye - others provide direct services up to Casablanca. The night-train (dep. 19:47 from Nador) doesn't even stop at Taourirt and thus doesn't have to change travel-direction.
Another project completed in 2010 is a short-cut between Rabat and Tangier. When completed trains can run directly to Rabat and Casablanca without having to use the longer route via Sidi Kasim. Also in the north a new track is built between Tangier and Ras R'Mel.
Other routes under construction are:
Not yet under construction, but planned are:
The most important project is the development of a "high-speed link" (TGV) from Tangier via Rabat and Casablanca to Marrakesh. The main contractor of this project is French company Alstom. The French president Nicolas Sarkozy was guest on 29 September 2011 when the actual construction of the line started. The first phase of the project is expected to be completed in 2012
Oujda railway station is the last station for passengers on the eastâÂÂwest link. The lines south of Oujda are for freight only and until the passenger-service starts the link Tangier-Tanger MED is also only operated for freight: mainly for the Renault factory at the port
The company makes a difference between the long-distance "Grandes Lignes", high-speed shuttle trains between Rabat and Casablanca, Urban transport in the Casablanca region and the "train by road" via daughter-company Supratours
On the mainline (Grand Lignes) several trains are operated per day. In the first class all chairs are assigned seats. On three main routes the ONCF operate special night trains with either full beds in private rooms of couchettes. On the Oujda-Casablanca route they run a "hotel train" which only offers beds and couchettes, no seats. These "Voyage de Nuit" is available on:
And on the route Tangier-Nador vv there is no official "night train" with beds or couchettes, but there is a night service from Tangier to Oujda or Nador
ONCF operates in three main sectors:
The turnover of the ONCF was growing, both in passengers and freight, until the decline of the economy in 2007. The number of passengers is still growing but freight figures are down. The total income on passengers (sold train tickets) and freight was in 2009 2.7 billion dirham.
In September 2006 ONCF proposed a high-speed rail connecting Tangier to Marrakesh which will reduce the time of the journey from around 10 hours to only hours. This service, if approved, may not be in operation until 2035. In 2007 Systra was appointed to design a 350 km/h alignment between Settat and Marrakesh.
This first part of the Atlantique high-speed link opened in 2018. It's 186 km long, holds the African rail speed record at 357 km/h and connects Tangier with Casablanca in 2 hours and 10 minutes (down from 4h45m previously). It was built for 9 million Euros per kilometer and ONCF projects that it carries 6 million passengers per year.
In December 2010, a contract was signed with Alstom to provide 14 trainsets based on the TGV Duplex.
The network that will carry the high-speed-network, from Tangier via Fez to Rabat and Marrakesh are currently already electrified. The lines to the east of Fez are diesel powered only and the majority of the track is single: opposite trains pass each other at selected train-stations.
For the Tangier-Casablanca line the ONCF will invest 20 billion Moroccan dirham (approx. US$2.5 bln.). Half of this money is needed to construct the track. From the other half 5.6 bln. dirham is needed for technology around the tracks and the remaining 4.4 bln. is needed for the rolling stock.
The funding of this project is coming from the state (4.8 bln. dirham), one billion from the Hasan II fund for social and economic development. France and the rest of Europe will donate some 2 billion dirham. The remaining 12.3 billion dirham is funded via loans under favourable conditions
Besides the high-speed link discussed above, the company is also developing other projects, including new rail links and extending the network's reach southwards of Marrakesh. One of the new links recently being constructed is a branch line from Taourirt to Nador. On 10 July 2009 king Mohammed VI of Morocco opened the two new railway stations in Nador and the line to Taourirt
ONCF is a member of the following organizations:
In December 2019 and according to a 2018 agreement, ONCF received the first Prima M4 electric locomotives of 30 more units that will be delivered by Alstom.