In 1510, the Spaniards had established themselves on a small island off Algiers, and forced the local ruler Sālim al-Tūmī (Selim-bin-Teumi) to accept their presence through a treaty and pay tribute.
[2] In 1516 however, the amir of Algiers Sālim al-Tūmī invited the corsair brothers Aruj and Khair ad-Din Barbarossa to expel the Spaniards.
This support was discontinued with Sultan Selim's death in 1520, causing Barbarossa to lose the city to a local kabyle chieftain in 1524,[2] and to retreat to his fief of Djidjelli.
[4] When Suleiman the Magnificent declared war on Emperor Ferdinand I in January 1529, he also wished to go on the offensive in the western Mediterranean, and therefore renewed Ottoman support for Barbarossa.
[4] After taking power in the city, Barbarossa then lay siege to the El Peñón de Argel, the Spanish fortress at the entrance of the harbour.