Ottoman Algeria

Ottoman Algeria, formally the Regency of Algiers, was an Ottoman territory centered on Algiers, in modern Algeria. It was established around 1525 when Hayreddin Barbarossa captured the city. The Regency of Algiers was the principal center of Ottoman Empire power in the Maghreb. It was also a base from which attacks were made on European shipping. It roughly covered the area of modern northern Algeria, between the states of Tunisia and Morocco. It rivaled and displaced the Zianids, the Hafsids and the Spanish possessions in northern Africa, and became a major hub of Mediterranean piracy, until the French invasion of Algiers in 1830.

Establishment
From 1496, the Spanish conquered numerous possessions on the North African coast, which had been captured since 1496: Melilla (1496), Mers-el-Kebir (1505), Oran (1509), Bougie (1510), Tripoli (1510), Algiers, Shershell, Dellys, Tenes.

Around the same time, the Muslim privateer brothers Aruj and Khair ad Din—the latter known to Europeans as Barbarossa, or Red Beard—were operating successfully off Tunisia under the Hafsids. In 1516, Aruj moved his base of operations to Algiers and asked for the protection of the Ottoman Empire in 1517, but was killed in 1518 during his invasion of the Kingdom of Tlemcen. Khair ad Din succeeded him as military commander of Algiers.

Occupation of Algiers
Aruj, Barbarossa's brother, captured Algiers in 1516, apart from the Spanish Peñón of Algiers. Following the death of Aruj in 1518 at the hand of the Spanish in the Fall of Tlemcen, Barbarossa requested the assistance of the Ottoman Empire, in exchange for acknowledging Ottoman authority in his dominions. Before Ottoman help could arrive, the Spanish retook the city of Algiers in 1519. Barbarossa recaptured the city definitively in 1525, and in 1529 the Spanish Peñon in the capture of Algiers.

Base in the war against Spain
Hayreddin Barbarossa established the military basis of the regency. The Ottomans provided a supporting garrison of 2,000 Turkish troops with artilley. He left Hasan Agha in command as his deputy when he had to leave for Constantinople in 1533.

The son of Barbarossa, Hasan Pashan was the first governor of the Regency to be directly appointed by the Ottoman Empire in 1544, when his father retired, and took the title of beylerbey. Algiers became a base in the war against Spain, and also in the Ottoman conflicts with Morocco.

Beylerbeys continued to be nominated for unlimited tenures until 1587. After Spain had sent an embassy to Constantinople in 1578 to negotiate a truce, leading to a formal peace in August 1580, the Regency of Algiers was a formal Ottoman territory, rather than just a military base in the war against Spain. At this time, the Ottoman Empire set up a regular Ottoman administration in Algiers and its dependencies, headed by Pashas, with 3 year terms to help considate Ottoman power in the Maghreb.

Mediterranean piracy
Despite the end of formal hostilities with Spain in 1580, attacks on Christian, and especially Catholic shipping, with slavery for the captured, became prevalent in Algiers, and was actually the main activity and source of revenues of the Regency.

In the early 17th century, Algiers also became with other North African harbours such as Tunis, one of the bases for Anglo-Turkish piracy, with as many as 8,000 renegades operating from the city in 1634. Hayreddin Barbarossa is credited with tearing down the Peñón of Algiers and using the stone to build the inner harbor.

A contemporary letter states: ""The infinity of goods, merchandise jewels and treasure taken by our English pirates daily from Christians and carried to Allarach, Algire and Tunis to the great enriching of Mores and Turks and impoverishing of Christians""

- Contemporary letter sent from Portugal to England.

Piracy and slavery of Christians originating from Algiers were a major problem throughout the centuries, leading to regular punitive expeditions by European powers. Spain (1567, 1775, 1783), Denmark (1770), France (1661, 1665, 1682, 1683, 1688), England (1622, 1655, 1672), all led naval bombardments against Algiers. Abraham Duquesne fought the Barbary pirates in 1681 and bombarded Algiers between 1682 and 1683, to help Christian captives.

Barbary Wars
During the early 19th century, the Regency of Algiers again resorted to widespread piracy against shipping from Europe and the young United States of America, mainly due to internal fiscal difficulties. This in turn led to the First Barbary War and Second Barbary Wars, which culminated in August 1816 when Lord Exmouth executed a naval Bombardment of Algiers.

French invasion
During the Napoleonic Wars, the Regency of Algiers had greatly benefited from trade in the Mediterranean, and of the massive imports of food by France, largely bought on credit by France. In 1827, Hussein Dey, Algeria's Ottoman ruler, demanded that the French pay a 31-year old debt, contracted in 1799 by purchasing supplies to feed the soldiers of the Napoleonic Campaign in Egypt.

The French consul Pierre Deval refused to give answers satisfactory to the dey, and in an outburst of anger, Hussein Dey touched the consul with his fan. Charles X used this as an excuse to break diplomatic relations. The Regency of Algiers would end with the French invasion of Algiers in 1830, followed by subsequent French rule for the next 132 years.

Demography
As of 1808, the population of the Regency of Algiers numbered around 3 million people, of whom 10,000 were 'Turks' (including people from Kurdish, Muslim Greek and Albanian ancestry ) and 5,000 Kouloughlis (from the Turkish kul oğlu, "son of slaves (Janissaries)", i.e. creole of Turks and local women). By 1830, more than 17,000 Jews were living in the Regency.