Capital of the nation since independence - and, before that, from 1912 to 1956, of the French Protectorate - RABAT is in many ways the city you'd expect: elegant in its spacious European grid, slightly self-conscious in its civilized modern ways, and, as an administrative centre, a little bit dull. If you arrive during Ramadan, you'll find the main avenues and boulevards an astonishing night-long promenade -at other time, it's hard to find a café open past ten at night. Rabat, as they tell you in Casa, is provincial. None of this makes any difference to the considerable historic and architectural interest in the city - and across the estuary in Salé - which include some of the finest and oldest Arab monuments in the country, dating from the Almohad and Merenid dynasties. You can spend an enjoyable few days looking round these, and out on the local beaches, and there is a major plus in that, unlike Fes or Marrakesh , you can get round the place quite happily without a guide, and talk in cafés with people who do not depend on tourist money.
Rabat's monuments punctuate the span of Moroccan history. The plains inland, designated Maroc Utile by the French, have been occupied and cultivated since paleolithic times, and there were Neolithic settlements on the coast south of Rabat, notably at present-day Temara and Skhirat. Both Phoenicians and Carthaginians established trading posts on modern-day Rabat's estuary site. The earliest Known settlement, Sala, occupied the citadel known today as Chellah. Here, after the demise of the Carthaginians, the Romans created their southernmost colony. It lasted well beyond the breakup of the empire in Africa and eventually formed the basis of an independent Berber state, which reached its peak of influence in the eighth century, developing a code of government inspired by the Koran but adapted to Berber customs and needs. It represented a challenge to the Islamic orthodoxy of the Arab rulers of the interior, however, and to stamp out the heresy, a ribat -the fortified monastery from which the city takes its name -was founded on the site of the present-day kasbah.
The ribat's activities led to Chellah's decline - a process hastened in the eleventh century by the founding of a new town, Salé, across the estuary. But with the arrival of the Almohads in the twelfth century, the Rabat Kasbah was rebuilt and a city again took shape around it. The Almohad fort, renamed Ribat El Fathi (Stronghold of Victory), served as a launching point for the dynasty's campaigns in Spain, which by 1170 had returned virtually all of Andalucia to Muslim rule.
Under the Almohad Caliph Yacoub El Mansour, a new Imperial Capital was created. Its legacy includes the superb Oudaîa Gate of the Kasbah, Bab Er Rouah at the southwest edge of town, and the early stages of the Hassan Mosque. Until recent years, this was the largest ever undertaken in Morocco and its minaret, standing high above the river, is still the city's great landmark. Mansour also erected over five kilometres of fortifications - but neither his vision nor his success in maintaining a Spanish empire was to be lasting. He left the Hassan Mosque unfinished, and only in the last sixty years has the city expanded to fill his dark circuit of pisé walls.
After Mansour's death, Rabat's significance was dwarfed by the imperial cities of Fes, Meknes and Marrakesh , and the city fell into neglect. Sacked by the Portuguese, it was little more than a village when, as New Salé, it was resettled by seventeenth-century Andalucian refugees. In this revived form, however, it entered into an extraordinary period of international piracy and local autonomy. Its corsair fleets, the Sallee Rovers, specialized in the plunder of merchant ships returning to Europe from West Africa and the Spanish Americas, but on occasion raided as far afield as plymouth and the Irish coast - Daniel Defoe's Robinson Crusoe began his captivity "carry'd prisoner into Sallee, a Moorish port".
The Andalucians, owing no loyalty to the Moorish sultans and practically impregnable within their Kasbah perched high on a rocky bluff above the river, established their own pirate state, the Republic of the Bou Regreg. They rebuilt the Medina below the kasbah in a style reminiscent if their homes in Spanish Badajoz, dealt in arms with the English and french, and even accepted European consuls, before the town finally reverted to government control under Moulay Rashid, and his successor, Moulay Ismail. Unofficial piracy continued until 1829 when Austria took revenge for the loss of a ship by shelling Rabat and other coastal towns. From then until the French creation of a capital, Rabat -Salé was very much a backwater.