text: In 1511, they took control over Cherchell and Jijel, and attacked Mostaganem where although they were not able to conquer the city, they were able to force a tribute on them.Early modern era In 1516, the Turkish privateer brothers Aruj and Hayreddin Barbarossa, who operated successfully under the Hafsids, moved their base of operations to Algiers.They succeeded in conquering Jijel and Algiers from the Spaniards with help from the locals who saw them as liberators from the Christians, but the brothers eventually assassinated the local noble Salim al-Tumi and took control over the city and the surrounding regions.Their state is known as the Regency of Algiers.When Aruj was killed in 1518 during his invasion of Tlemcen, Hayreddin succeeded him as military commander of Algiers.The Ottoman sultan gave him the title of beylerbey and a contingent of some 2,000 janissaries.With the aid of this force and native Algerians, Hayreddin conquered the whole area between Constantine and Oran (although the city of Oran remained in Spanish hands until 1792).The next beylerbey was Hayreddin's son Hasan, who assumed the position in 1544.He was a Kouloughli or of mixed origins, as his mother was an Algerian Mooresse.Until 1587 Beylerbeylik of Algiers was governed by Beylerbeys who served terms with no fixed limits.Subsequently, with the institution of a regular administration, governors with the title of pasha ruled for three-year terms.The pasha was assisted by an autonomous janissary unit, known in Algeria as the Ojaq who were led by an agha.Discontent among the ojaq rose in the mid-1600s because they were not paid regularly, and they repeatedly revolted against the pasha.As a result, the agha charged the pasha with corruption and incompetence and seized power in 1659.Plague had repeatedly struck the cities of North Africa.