Rabat is the capital of the Kingdom of Morocco. It is also the capital of the Rabat-Salé-Zemmour-Zaer region.
The city is located on the Atlantic Ocean at the mouth of the river Bou Regreg. On the facing shore of the river lies Salé, Rabat's bedroom community. Together the two cities account for a population of 1.3 million. Unfortunately, silting problems have diminished the city's role as a port; however, Rabat and Salé still maintain relatively important textile, food processing, and construction industries.
In addition, tourism and the presence of all foreign embassies in Morocco serve to make Rabat the second most important city in the country after the larger and more economically significant Casablanca.
Rabat's history began with a settlement, known as Chellah on the banks of the Oued Bou Regreg in the third century BC. In 40 AD, Romans took over Chellah and converted it to the Roman settlement of Sala Colonia. Rome held the colony until 250 AD when they abandoned it to Berber rulers. The Berbers played an important role in Muslim Spain. 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 Spain. In 1170, due to its military importance, Rabat acquired the title Ribatu l-Fath, meaning "stronghold of victory," from which it gets its current name.
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 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, including 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. They attempted to establish control over the pirates, but failed. European and Muslims 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 invaded Morocco in 1912 and established a protectorate. The French administrator of Morocco, General Hubert Lyautey, decided to relocate the country's capital from Fez to Rabat. Among other factors, rebellious Berbers (native Moroccans) had made Fez an unstable place. Sultan Moulay Youssef followed the decision of the French and moved his residence to Rabat. In 1913, Gen. Lyautey hired Henri Prost who designed the Ville Nouvelle (Rabat's modern quarter) as an administrative sector. When Morocco achieved independence in 1956, Mohammed V, the then King of Morocco, chose to have the capital remain at Rabat.
Information based on http://en.wikipedia.org/wiki/Rabat