These troops were headed by the Beys, and a Khalifa (general) appointed by them. Levying these troops was the job of the Bey. The Odjak was headed by an Agha elected by the Odjak itself. When Algiers came under attack, the Beyliks would send their troops to help the besieged city, such as in 1775 during the Spanish Invasion of Algiers. As the Beys were regional commanders, they also fought the wars in their own region, occasionally reinforced by troops from the Dar as-Soltan army. For example in 1792, during the reconquest of Oran the Bey of Oran, Mohamed el-Kébir (Bey of Oran) was the one to besiege the city using the army of the Beylik of the West, numbering up to 50,0000 with some additional reinforcements from Algiers. During the Algerian-Tunisan war of 1807 the Eastern army fought the war against the Tunisian armies. Its composition was 25,000 levy warriors from Constantine, and 5,000 reinforcements from Algiers. Sub-commanders usually included powerful tribal Sheiks, djouads, or caids.