Ottoman wars in Africa

The Ottoman Empire was founded at the beginning of the 14th century. Beginning by the 16th century it also began acquiring possessions through a series of wars in Africa.

Egypt
Egypt was under the rule of a military cast named Mamluks. Mamluks were actually Turks and Circassians. In addition to Egypt they also controlled Syria, Palestine Lebanon and Jordan. After Mehmet II (the Conqueror) united most of Anatolia under Ottoman rule, the two empires became neighbours of each other where two Mamluk vassals of Turkmen origin were the buffer states between the two. During the Ottoman-Safavid Persia war, Mamluks (or their vassals) supported Persia. Selim I (the Grim) of the Ottoman Empire used this claim as a pretext to wage a war on Mamluks. During Selim’s long campaign to Egypt in 1516-18, Mamluks were defeated three times; in the battles Marj Dabiq and Yaunis Khan on the way to Egypt and in the Battle of Ridanieh in Egypt  (The first and the third personally commanded by Selim and the second by Hadim Sinan Pasha). The third battle in which Hadim Sinan Pasha fell was the final blow to Mamluks. After clashes in Cario, Tumanbay II the Mamluk sultan was arrested and Selim annexed whole Mamluk territory, enlarging the Ottoman Empire more than two times in only two years.

Algeria
Turkish corsair Barbaros Hayreddin in 1516, captured the city of Algiers from the Holy Roman Empire. Although initially Barboros and his brothers were independent, after his elder brother's death, Barbaros appealed to Selim for protection. In 1532, during the reign of Süleyman I (the Magnificent),  Barbaros was appointed as the grand admiral of the Ottoman navy and Algeria became an Ottoman possession. Eventually the Ottomans began controlling the hinterland also. In 1552, Salih Reis an Ottoman admiral, marched over the Sahara and captured Touggourt.

Tunisia
In the early years of the 16th century Tunisia was ruled by Hafsid dynasty of Berber origin. Although Tunis, the most important city of Tunisia was captured by Barbaros on behalf of the Ottoman Empire in 1534, next year during the reign of Charles V, a navy of the Holy Roman Empire took the city. In the year 1560, an Ottoman navy commanded by Piyale Pasha defeated a large navy of the Holy Roman Empire in the Battle of Djerba. After this battle Uluç Ali Reis of the Ottoman Empire captured the city for the second time in 1569 during the reign of Selim II. Two years later the city was lost to Holy Roman Empire for the second time. Finally in 1574, an Ottoman navy commanded by the grand admiral Sinan Pasha captured the city for the third time.

Libya
After Knights Hospitaller left the island of Rhodes in 1522, some of them had settled in Tripoli, the most important city of Libya. In 1551, Ottoman admiral Turgut Reis (also known as Dragut) captured the city with the help of Sinan Pasha. Eventually Benghazi and the hinterland Fezzan were also annexed. Between 1711 and 1835 Libya became autonomous under Karamanlı dynasty (a dynasty founded by a military ruler from Karaman, Turkey). After 1835 Mahmut II reestablished Ottoman control.

Horn of Africa
In 1538 Süleyman I sent a navy to the Indian Ocean. (see Ottoman naval expeditions in the Indian Ocean) The expeditions continued for about 30 years. Özdemir Pasha the deputy of the admiral conquered the west bank of the Red Sea (roughly corresponding to a narrow coastal strip of Sudan and Eritrea) in 1567 during the reign of Selim II. In 1585, during the reign of Murat III, Ottoman corsair Emir Ali (also called Miral Bey) captured Mogadishu (now capital of Somalia) from the Portuguese navy. But the Ottoman control in Mogadishu continued only for four years.

West Africa
The Ottomans frequently interfered in the affairs of Morocco, and even captured Fes briefly in 1576 to enthrone their candidate as the Sultan of Fes. During the Battle of Alcácer Quibir in 1578, they actively fought on the side of Morocco against Portugal. According to Lord Kinross Morocca fell under Ottoman influence. In 1585, Ottoman admiral Murat Reis captured the island of Lanzarote in the Canary islands off the West African coast. Although he soon withdrew, it was notable as the sole Ottoman conquest in the Atlantic Ocean.

Aftermath
The Ottoman Empire lost direct control of Egypt and the lands to the south during the revolt of Kavalalı Mehmet Ali Pasha in the 1830s. Although Egypt was still considered an Ottoman vassal, the Ottoman Empire totally lost control in the 1880s to the British Empire. By the 19th century, Ottoman control of the countries west of Egypt was also weakened. Algeria was lost in 1830 and Tunis was lost in 1881, both to France. Libya, the last Ottoman territory in Africa was lost to Italy at the end of the Italo-Turkish War in 1911.