The Rustamid kingdom is a former Ibadist kingdom in Algeria. The Rustamid Kingdom had an Ibadite dynasty which ruled Algeria from 779 until 909. The Rustamids are the longest-lasting Ibadi kingdom in north Africa.