on the periphery of both the Ottoman and European economic spheres, and depending for its existence on a Mediterranean that was increasingly controlled by European shipping, backed by European navies, piracy became the primary economic activity. Repeated attempts were made by various nations to subdue the pirates that disturbed shipping in the western Mediterranean and engaged in slave raids as far north as Iceland. By the 17th century, up to 40% of the city's 100,000 inhabitants were enslaved Europeans. The United States fought two wars (the First and Second Barbary Wars) over Algiers' attacks on shipping. Among the notable people held for ransom was the future Spanish novelist, Miguel de Cervantes, who was held captive in Algiers for almost five years, and wrote two plays set in Algiers of the period. The primary source for knowledge of Algiers of this period, since there are no contemporary local sources, is the Topografía e historia general de Argel (1612, but written earlier), published by Diego de Haedo, but whose authorship is disputed. This work describes in detail the city, the behavior of its inhabitants, and its military defenses, with the unsuccessful hope of facilitating an attack by Spain so as to end the piracy. A significant number of renegades lived in Algiers at the time, Christians converted voluntarily to Islam, many fleeing the law or other problems at home. Once converted to Islam, they were safe in Algiers. Many occupied positions of authority, such as Samson Rowlie, an Englishman who became Treasurer of Algiers. The city under Ottoman control was enclosed by a wall on all sides, including along the seafront. In this wall, five gates allowed access to the city, with five roads from each gate dividing the city and meeting in front of the Ketchaoua Mosque. In 1556, a citadel was constructed at the highest point in the wall. A major road running north to south divided the city in two: The upper city (al-Gabal, or 'the mountain') which consisted of about fifty small quarters of Andalusian, Jewish, Moorish and Kabyle communities, and the lower city (al-Wata, or 'the plains') which was the administrative, military and commercial centre of the city, mostly inhabited by Ottoman Turkish dignitaries and other upper-class families. In August 1816, the city was bombarded by a British squadron under Lord Exmouth (a descendant of Thomas Pellew, taken in an Algerian slave raid in 1715), assisted by