A Phoenician commercial outpost called Ikosim which later developed into a small Roman town called Icosium existed on what is now the marine quarter of the city. The rue de la Marine follows the lines of what used to be a Roman street. Roman cemeteries existed near Bab-el-Oued and Bab Azoun. The city was given Latin rights by Vespasian. The bishops of Icosium are mentioned as late as the 5th century.
The present-day city was founded in 944 by Buluggin ibn Ziri, the founder of the Berber Zirid-Senhaja dynasty, which was overthrown by Roger II of Sicily in 1148, although the Zirids had already lost control of Algiers before the final fall of the dynasty. The city was occupied by the Almohades in 1159, and in the 13th century came under the dominion of the Abd-el-Wadid sultans of Tlemcen.
Nominally part of the sultanate of Tlemcen, Algiers had a large measure of independence under amirs of its own due to Oran being the chief seaport and center of power of the Abd-el-Wahid.