Chronicle of the Middle East and North Africa

Libya: Ottoman Control, Corsairs and Qaramanlis (16th -18th Centuries)

Libya Ottoman Control
John Sellar’s “Mapp of the Citie and Port of Tripoli in Barbary” 1675. The map shows the fortified city, the gardens and agricultural area outside the walls, with olive trees, and the anchorage protected by sandbanks and a harbour mole. Source: Wikimedia/Wesleyan University

Spanish-Ottoman conflict in the Mediterranean

The Mediterranean was a battlefield in the sixteenth century. The Habsburgs controlled the Holy Roman Empire, Spain and a growing empire in the Americas. Their rivals, the Ottomans, took Constantinople in 1453, and spread southwards through Syria and Egypt at the beginning of the 16th century. These two great powers vied for power by seizing coastal positions.

In 1510 Spanish forces occupied Tripoli, a great strategic advance. They then razed much of the city to the ground the following year. In 1530 Charles V of Spain handed it, along with Malta, to the Knights of St. John. This gave the Knights control of the main sea passage between the eastern and western Mediterranean. In the war between the Ottomans and the Spanish, with their Maltese and Genoese allies, Ottoman naval forces attacked the northern coast of the Mediterranean. Although Ottoman troops failed to take Malta in the Great Siege of 1565, they expelled the Spanish from Tunisia and in 1551 the Turkish commander Turgut Reis (or Dragut) retook Tripoli and set about rebuilding the fortifications, with a fortress at the north west-end of the city and a mosque that was named after him.


Libya Ottoman Control
Turghut Pasha’s mosque in Tripoli (also known as Darghut Mosque), notable for its tall pointed minaret, frequent in Ottoman mosque architecture. Photo Abdul-Jawad al-Husuni, Wikimedia Commons

The fortification of Tripoli was essential both to Ottoman strategy and to the survival of the city because it provided a way for the city to prosper. Despite the importance of the desert trade routes, Tripoli was always oriented towards the sea to provide the major income. On both sides, Christian and Muslim, corsairs, who are best seen as naval officers acting for profit, waged the war at sea.

Central authority in Ottoman North Africa was diffuse and the Ottomans relied on locally autonomous regimes. In 1587 Tripoli, Tunis and Algiers each became a separate province, with its own Pasha. The Sultan in Istanbul still held overarching political and religious authority, but in reality, local military commanders now exercised power, at the head of what were really armies of occupation.

In Tripoli, the smallest and poorest of the three provinces, the militia commander, the dey, headed the government under a nominal Ottoman pasha. But the diwan or council was riven by disputes and rivalries between factions of military men. Turks or kulughlis (descendants of Turkish men and local women) controlled the militia on land. At sea, the naval commanders (sing. ra’is) were Turks or Christian converts to Islam, the men the Europeans called renegades. These outsiders viewed Tripoli as an economically poor province to exploit.

In 1669 Uthman Dey, having persuaded the sultan to appoint him pasha, wrote to Charles II of England and Scotland, describing Tripoli as ‘the little that this sterill Country doth produce.’ Foreigners like Thomas Baker, English consul from 1679 to 1685, called it ‘a Barren blind comfortlesse corner of Barbary.’ In 1685 Tripoli’s population was estimated at just under 40,000 people. Yet the fertile area around Tripoli produced food for the population and for export, and was a place where the affluent built their houses among the gardens. There were abundant supplies of salt, a valuable export. The trans-Saharan trade provided slaves. Turks and kulughlis lived parasitically off the trading economy by extracting money by force or by demanding protection fees. The naval commanders did much the same at sea, raiding merchant ships or selling immunity from attack.


Corsairs were persons who were licensed by the state authorities in the Mediterranean to raid the shipping of other states for profit. They were privateers, with the difference that the ‘enemy’ was defined in religious terms. Maltese corsairs raided Muslim shipping and Muslim corsairs from the north African states raided Christian shipping. The prizes they took – the ships, their cargoes and their crews were sold or ransomed. Between 1679 and 1685 consul Baker reported that Tripoli corsairs captured 71 ships with a total value of 1 million Spanish dollars and just under 1,100 men with a value of $247,000.

The proceeds were divided between the state and the naval commanders, crews, and owners of the ships. The targets were the ships of the smaller Christian states, such as Italy, Malta and Greece. The larger European powers, the French, Dutch, and British, had much more powerful navies which bombarded Algiers, Tunis and Tripoli several times in the 17th century. Sometimes the threat was enough to force the rulers to make treaties of peace. But making peace decreased the revenue of the commanders, who on occasion rebelled. Consul Baker describes an unstable political structure, where the ruler objected to diplomatic agreements with European powers that limited their earnings from sea-raiding.

The Desert Trade

Trade across the Sahara was profitable. Luxury goods (cloth, ivory, ostrich feathers, gold, goatskins, guns, and slaves) were exported and cloth and guns, in demand among rulers and the rich in West African kingdoms, were imported from Europe. However, it was unpredictable because Ottoman control did not extend far inland. In the Fezzan, the Awlad Muhammad ran a trading state of their own which was the largest market between the Mediterranean coast and Egypt in the north and a sub-Saharan Africa (Bilad al-Sudan) to the south. The Awlad Muhammad resisted Ottoman power, even when the authorities in Tripoli sent expeditions to bring them into line.

The Qaramanlis

In 1711 a Kulughli officer named Ahmad Qaramanli ended the political instability. He took command of the troops, sent away the pasha, the nominal governor appointed by the sultan, and brutally imposed his own control. Eleven years later the Sultan made Ahmad pasha. Ahmad sealed himself in power by expanding corsairing which he directed at the shipping of the minor Mediterranean powers. Some of those powers paid him an annual subsidy, protection money to exempt them from attack. Ahmad made stable treaties of peace and commerce with bigger powers, such as Britain and France.

Inside the walls of Tripoli, Ahmad built an aqueduct, markets (suqs), places for traders to stay, and a new and impressive mosque with a college (madrasa) attached. The castle was repaired and greatly enlarged. By the time Ahmad died in 1745, he had created a stable state and the basis of a dynasty. Power passed to his descendants Mohammed Pasha (1745-1754), Ali Pasha (1754-1795), Ahmed II Pasha (1796), Yusuf Pasha (1796–1832) and Ali II Pasha (1832-1835).

The trade passed through the Fezzan, which belonged to the Awlad Muhammad (see the coming of Islam). Qaramanli power was confined to the coast. Coastal agriculture, despite its instability, also developed, especially after the British took Malta in 1800. By 1810 Tripoli supplied the British naval base with most of its meat and grain. As Tripoli prospered, the Jewish community grew very important. By 1783 there were around 3,000 Jews among a population of 14,000. The Christian community was smaller, but at the beginning of the 19th century, the number of Christians increased due to Maltese emigrating to Libya.

The Qaramanli Dynasty. Source: C.R. Pennell.

The End of the Qaramanlis

Yusuf Pasha Qaramanli tried to expand his revenue by increasing attacks on Christian shipping. This led to conflict with the newly independent United States of America. The US government refused to pay protection money, and, when Yusuf increased taxes, there was a brief civil war between him and his brother, instigated by the US. In 1803 the US declared war, which they eventually won by blockading Tripoli and landing troops in Cyrenaica. This was the USA’s first foreign war and is commemorated in the US Marine Corps Hymn:

From the Halls of Montezuma,
To the shores of Tripoli;
We fight our country’s battles
In the air, on land, and sea.

In 1832 Yusuf abdicated in favour of his son, Ali II, and Ottoman troops landed to restore order. In effect, the Ottomans had to reconquer the country, using the tactics of colonial war employed by European powers. The sultan did not allow another dynasty to take the Qaramanlis’ place.