The early history of the mosque is debated, with some sources indicating a mosque on the site as early as the 11th century, but the first verifiable reference dates from 1612/1020 AH. The most has been demolished and rebuilt multiple times since. It took on its current form under the government of Dey Hassan in 1794/1208 AH. After colonization in 1832, it was forcibly taken from a group of defenders for conversion to a church. In 1844, it was again demolished and rebuilt as the Cathédrale Saint-Philippe. With the end of colonization in 1962, it once again began to function as a mosque. The name is said to come from the Turkish word for "goat," in reference to a livestock market formerly located nearby.
Sources:
Dokali, Rachid. Les mosquées de la période turque à Alger. Algiers: SNED. c. 1974.
Klein, Henri. Feuillets d’El Djazair, Tome I et II, Alger, Edition du Tell, 2003.
Ministry of Information and Culture, Algeria, with M. Dokali and M. Bourouiba. Les mosquées en Algérie. Algiers: SNED. 1974.