 Though nominally serving at the caliph's pleasure, Al Aghlab and his successors, the Aghlabids, ruled independently until 909, presiding over a court that became a center for learning and culture.Just to the west of Aghlabid lands, Abd ar Rahman ibn Rustam ruled most of the central Maghreb from Tahert, south-west of Algiers.The rulers of the Rustamid imamate (761–909), each an Ibadi imam, were elected by leading citizens.