Rabat (, also , ; French: [ʁaba]; Arabic: الرِّبَاط, romanized: ar-ribāṭ; Berber languages: ⴰⵕⴱⴰⵟ, romanized: Aṛṛbaṭ) is the capital city of Morocco and the country's seventh largest city with an urban population of approximately 580,000 (2014) and a metropolitan population of over 1.2 million. It is also the capital city of the Rabat-Salé-Kénitra administrative region. Rabat is located on the Atlantic Ocean at the mouth of the river Bou Regreg, opposite Salé, the city's main commuter town.
Rabat was founded in the 12th century by the Almohad ruler Abd al-Mu'min as a military town. The city steadily grew but went into an extended period of decline following the collapse of the Almohads. In the 17th century Rabat became a haven for Barbary pirates. The French established a protectorate over Morocco in 1912 and made Rabat its administrative center. Morocco achieved independence in 1955 and Rabat became its capital.
Rabat, Temara, and Salé form a conurbation of over 1.8 million people. Silt-related problems have diminished Rabat's role as a port; however, Rabat, and Salé still maintain important textile, food processing and construction industries. In addition, tourism and the presence of all foreign embassies in Morocco serve to make Rabat one of the most important cities in the country. The Moroccan capital was ranked at second place by CNN in its "Top Travel Destinations of 2013". It is one of four Imperial cities of Morocco, and the medina of Rabat is listed as a World Heritage Site. Rabat is accessible by train through the ONCF system and by plane through the nearby Rabat–Salé Airport.
The name Rabat comes from الرِّبَاط (ar-ribāṭ) meaning the ribat, an Islamic base or fortification. This name is short for رِبَاط الفَتْح (ribāṭu l-fatḥ) meaning the ribat of conquest or stronghold of victory—a title the city acquired in 1170, due to its military importance.
Rabat has a relatively modern history compared to the nearby ancient city of Salé. In 1146, the Almohad ruler Abd al-Mu'min  turned Rabat's ribat into a full-scale fortress to use as a launching point for attacks on Iberia.
Yaqub al-Mansur (known as Moulay Yacoub in Morocco), another Almohad Caliph, moved the capital of his empire to Rabat. He built Rabat's city walls, the Kasbah of the Udayas and began construction on what would have been the world's largest mosque. However, Yaqub died and construction stopped. The ruins of the unfinished mosque, along with the Hassan Tower, still stand today.
Yaqub's death initiated a period of decline. The Almohad empire lost control of its possessions in Spain and much of its African territory, eventually leading to its total collapse. In the 13th century, much of Rabat's economic power shifted to Fez. In 1515 a Moorish explorer, El Wassan, reported that Rabat had declined so much that only 100 inhabited houses remained. An influx of Moriscos, who had been expelled from Spain, in the early 17th century helped boost Rabat's growth.
Rabat and neighboring Salé united to form the Republic of Bou Regreg in 1627. The republic was run by Barbary pirates who used the two cities as base ports for launching attacks on shipping. The pirates did not have to contend with any central authority until the Alaouite Dynasty united Morocco in 1666. The latter attempted to establish control over the pirates, but failed. European and Muslim authorities continued to attempt to control the pirates over many years, but the Republic of Bou Regreg did not collapse until 1818. Even after the republic's collapse, pirates continued to use the port of Rabat, which led to the shelling of the city by Austria in 1829 after an Austrian ship had been lost to a pirate attack.
The French invasion of Morocco began in the east with General Hubert Lyautey's occupation of Oujda March 1907 and in the west with the Bombardment of Casablanca August 1907. The Treaty of Fes established the protectorate March 1912. Acting as French administrator of Morocco, Lyautey, decided to relocate the country's capital from Fes to Rabat. Among other factors, rebellious citizens had made Fes an unstable place. Sultan Moulay Youssef followed the decision of the French and moved his residence to Rabat. In 1913, Lyautey hired Henri Prost who designed the Ville Nouvelle (Rabat's modern quarter) as an administrative sector. When Morocco achieved independence in 1955, Mohammed V, the then King of Morocco, chose to have the capital remain at Rabat.
Following World War II, the United States established a military presence in Rabat at the former French air base. By the early 1950s, Rabat Salé Air Base was a U.S. Air Force installation hosting the 17th Air Force and the 5th Air Division, which oversaw forward basing for Strategic Air Command (SAC) B-47 Stratojet aircraft in the country. With the destabilization of French government in Morocco, and Moroccan independence in 1956, the government of Mohammed V wanted the U.S. Air Force to pull out of the SAC bases in Morocco, insisting on such action after American intervention in Lebanon in 1958. The United States agreed to leave as of December 1959, and was fully out of Morocco by 1963. SAC felt the Moroccan bases were much less critical with the long range capability of the B-52 Stratofortresses that were replacing the B-47s and with the completion of the USAF installations in Spain in 1959.
With the USAF withdrawal from Rabat-Salé in the 1960s, the facility became a primary facility for the Royal Moroccan Air Force known as Air Base Nº 1, a status it continues to hold.
Rabat is an administrative city. It does have many shopping districts and residential neighbourhoods. The geographically spread out neighbourhoods are as follows:
The heart of the city consists of three parts: the Medina (old town); the Oudayas and Hassan both located to meet the Bou Regreg; and the Atlantic Ocean.
To the west, and along the waterfront, there is a succession of neighbourhoods.
First, around the ramparts, there is the old neighbourhoods, Quartier l'Océan and Quartier les Orangers. Beyond that, a succession of mostly working-class districts: Diour Jamaa, Akkari, Yacoub El Mansour, Massira and Hay el Fath are the main parts of this axis. Hay el Fath, which ends this sequence, evolves into a middle-class neighbourhood.
To the east, along the Bouregreg, the Youssoufia region (working and middle class) : Mabella; Taqaddoum; Hay Nahda(mostly middle class); Aviation(middle and upper middle class); and Rommani.
Between the two axes, from north to south, there are three main neighbourhoods (middle class to affluent): Agdal (Ward Building; a lively mix of residential and commercial buildings. The residents are predominantly upper middle class); Hay Riad (affluent villas; this neighbourhood has experienced a surge of momentum since the 2000s); and Souissi (residential neighborhood).
On the outskirts of Souissi, are a number of less-dense regions mainly comprising large private houses to areas that seem out of the city.
Located between the Atlantic and the Bouregreg Valley, this river marina is paved with famous historical sites like the esplanade of the Hassan Tower and the picturesque Chellah necropolis, which has witnessed many Mediterranean civilizations pass by.
Outfitted with the most modern equipment to host up to 240 boats, the Bouregreg Marina aims to become an essential destination for recreational boaters seeking long stays or just a stopover on their way to West Africa, the Caribbean or the shores of North America.
Called Rbatis, these families have lived for more than 400 years with many events in common. From the expulsion of the Moriscos to arrive at the foundation of a culture that combines the Arabic and Andalusian cultures, through the Republic of Bouregreg events than other families coming to live in Rabat recently, have not known.
Since its founding, Rabat was inhabited by several families from the High Atlas with Abu Yusuf Yaqub al-Mansur, who founded the city in 1198, then families from many parts of Morocco have settled. Rabat has around 1240 a few hundred fifty families whose families Chiadmi, Regragui, Loudiyi, etc.
Since the end of the thirteenth century, the city has had an influx of Moriscos expelled from Granada until 1609, the year of total expulsion of Muslims from Spain by Philip III. These families include: Bargach (Vargas); Guedira (Guadaira); Mouline (Molina); Sebbata (Zapata); and Frej.
The said families are considered, until today, as "Rbati's Families of strain". They are about four hundred families.
Other families in the city are considered residents of Rabat because they came at the time when Rabat became the capital of the country, either through rural exodus or to work in public administration based in the city since the establishment of the protectorate.
The city is on the territory of Zaer, an Arab tribe of Maqil origin. Leo Africanus in the early 16th century the signals in the region of Khenifra there, she continued on to the north to the Rabat region.
Rabat features a Mediterranean climate (Csa) with warm to hot dry summers and mild damp winters. Located along the Atlantic Ocean, Rabat has a mild, temperate climate, shifting from cool in winter to warm days in the summer months. The nights are always cool (or cold in winter, it can reach sub 0 °C (32 °F) sometimes), with daytime temperatures generally rising about 7–8 °C (13–14 °F). The winter highs typically reach only 17.2 °C (63.0 °F) in December–February. Summer daytime highs usually hover around 25 °C (77.0 °F), but may occasionally exceed 30 °C (86.0 °F), especially during heat waves. Summer nights are usually pleasant and cool, ranging between 11 °C (51.8 °F) and 19 °C (66.2 °F) and rarely exceeding 20 °C (68.0 °F). Rabat belongs to the sub-humid bioclimatic zone with an average annual precipitation of 560 mm (22 in).
The biggest place for theatre is the Theatre Mohammed V in the centre of the town.
The city has the Rabat Archaeological Museum and the Musée Mohamed VI d'Art Moderne et Contemporain.
Many organizations are active in cultural and social issues. Orient-Occident Foundation and ONA Foundation are the biggest of these. An independent art scene is active in the city. L'appartement 22, which is the first independent space for visual arts created by Abdellah Karroum, opened in 2002 and introduced international and local artists. Other independent spaces opened few years after, such as Le Cube, also set up in a private space.
Mawazine is a music festival in Rabat welcomed by Mohammed VI King of Morocco, that started in 2001 where music groups, fans and spectators come together in a week-long celebration of culture and music both locally and internationally. Musicians such as Scorpions, Rihanna, Elton John, Stromae and many others have performed at the festival.
Mawazine was host to more than 2,500,000 in 2013. Workshops are available for teaching dances and other arts. The festival is free. However, while most areas are free, there are those that require payment, specifically the smaller stages being the historical site of Chellah, the Mohammed V National Theater, and the Renaissance Cultural Center.
The places of worship are predominantly Muslim mosques. The last remaining synagogue in Rabat is the Rabbi Shalom Zawi Synagogue. There are also Christian churches and temples, including an Evangelical church and St. Peter's Cathedral, which hosts the Roman Catholic Archdiocese of Rabat.
Rabat is served by two principal railway stations run by the national rail service, the ONCF.
ONCF operates the Le Bouregreg urban rail for Rabat-Salé agglomeration.
The Rabat-Salé tramway is a tram system which was put into service on May 23, 2011 in the Moroccan cities of Rabat and Salé. The network has two lines for a total length of 19 km (12 miles) and 31 stops. It is operated by Veolia Transdev with Alstom Citadis trams.
After some years of neglect as investment was directed at the tramway, the existing operator, STAREO, was displaced in 2019. A contract was awarded to Alsa-City Bus, a joint venture between Moroccan company City Bus and Spanish company Alsa s.a, a subsidiary of the UK's National Express Group. The new operator took over in July 2019 with a commitment to three hundred and fifty new buses. These will comprise 102 Mercedes-Benz and 248 Scania-Higer vehicles. The contract covers a 15-year period, renewable for seven years, and promises approximately 10 billion dinars investment into the bus transport system in the region. 
Prince Moulay Abdellah Stadium (Arabic: مركب الأمير مولاي عبد لله) is a multi-purpose stadium in Rabat, Morocco. It is named after Prince Moulay Abdellah. It was built in 1983 and is the home ground of ASFAR (football club). It is used mostly for football matches, and it can also stage athletics. The stadium holds 52,000. Since 2008 it is host of the Meeting International Mohammed VI d'Athlétisme de Rabat.