Sale lies on the north bank of the mouth of the Bouregreg river opposite Rabat ,of which it is now mainly a suburb. But Sale was a thriving city when Rabat was a nothing much village. It was notorious as the base of the Barbary Coast pirates the originators of the "White Slave Trade", (as opposed to "the Slave Trade"?!). At one time the Rue des Conseilles in Rabat, now the main souk, once populated by the consuls of various european states whose sole occupation was to find out which of their countrymen were in captivity in Sale and to ransom them before they could be sold on. One dutch consul was so good at rescuing his clients he was driven out.
The main corsairs were andalusian refugees and in the 17C they established their own state, the Republic of the Bouregreg, plundering european vessels returning from West Africa and South America but also making raids on european ports including Plymouth and the Irish coast. They caused similar consternation as the somali pirates of the noughties. They eventually surrendered to Moulay Rashid but impromptu piracy continued until 1829 when Austria lost patience over the loss of a ship and shelled both Sale and Rabat into a backwater until the French made it the capitol under the Protectorate.
The whole encaptured the popular european imagination and Defoe had Crusoe captured by pirates and brought to Sale where he describes him entering by the Bab Lamrissa. Built in 1261 by the architect Mohammed Ibn Haj Ichbili it was 30m high and open to the river to allow boat to pass into the harbour. Now it is stranded next to the tram station.