Capture of Algiers (1516)
In 1510, the Spaniards had established themselves on a small island in front of Algiers, and forced the local ruler Sālim al-Tūmī (Selim-bin-Teumi) to accept their presence through a treaty and pay tribute. Fortifications were built on the islet, and a garrison of 200 men was established. Sālim al-Tūmī had to go to Spain to take an oath of obedience to Ferdinand of Aragon.
Capture of Algiers
In 1516, the amir of Algiers, Sālim al-Tūmī, invited the corsair brothers Oruç and Hayreddin Barbarossa to expel the Spaniards. Oruç, with the help of Ottoman troops, came to Algiers, ordered the assassination of Sālim, and seized the town. Spanish expeditions were sent to take over the city, first in 1516 under Don Diego de Vera, and then in 1519 under Don Ugo de Moncada, but both expeditions ended in failure.
Hayreddin succeeded Oruç after the latter was killed in battle against the Spaniards at the Fall of Tlemcen (1517), as well as inheriting his nickname "Barbarossa". The capture of Algiers in 1516 had been made possible with the support of the Ottoman Sultan Selim I. This support was discontinued with Sultan Selim's death in 1520, causing Barbarossa to lose the city to a local kabyle chieftain in 1524, and to retreat to his fief of Djidjelli.