The Regency of Algiers (in ), was a state in North Africa lasting from 1516 to 1830, until it was conquered by the French. Situated between the regency of Tunis in the east and the Sultanate of Morocco (from 1553) in the west (and the Spanish and Portuguese possessions of North Africa), the Regency originally extended its borders from La Calle in the east to Trara in the west and from Algiers to Biskra, and after spread to the present eastern and western borders of Algeria. It had various degrees of autonomy throughout its existence, in some cases reaching complete independence, recognized even by the Ottoman sultan. The country was initially governed by governors appointed by the Ottoman Sultan (1518-1659), rulers appointed by the Odjak of Algiers (1659-1710), and then Deys elected by the Divan of Algiers.