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 Aruj and Khair ad-Din Barbarossa to expel the Spaniards. Aruj, 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.
Khair ad-Din, succeeding Arouj after the latter was killed in battle against the Spaniards at the Fall of Tlemcen (1517). 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.