the princely state is said to have been established in the 17th century as a muslim khanate by akhund baba (also known mulla ilyas), the leader of a pakhtun clan, and ruled afterwards by his descendants. a member of the painda khel's leading family, mulla ilyas, was recognized as spiritual leader because of his religious merits, who procured him the title of akhund ("scholar" in persian) baba. thanks to his charisma, akhund acquired a prominent position in the malizai tribe and founded the dir village. his successors managed to preserve and expand the leadership, giving birth to an embryonal autonomous political entity which would eventually become the princely state. the clan of mulla illas khan would take the name of akhund khel from the name of its progenitor, and a dynasty stemming from him was recognized as khans (rulers) of dir. however, till the end of the 19th century, the dominion of the family was limited to the upper dir.