It is said to have been founded about 1665 by a powerful landholder named Azim Khan, who owned large estates in this part of the country.
After some delay and desultory fighting, he and his uncle, Azim Khan, occupied Kabul (March 1866).
Notwithstanding the new amir's incapacity, and some jealousy between the real leaders, Abdur Rahman and his uncle, they again routed Shere Ali's forces, and occupied Kandahar in 1867; and when at the end of that year Afzul Khan died, Azim Khan succeeded to the rulership, with Abdur Rahman as his governor in the northern province.
Before his death at Herat, 9th June 1863, Dost Mahomed had nominated as his successor Shere Ali, his third son, passing over the two elder brothers, Afzul Khan and Azim Khan; and at first the new amir was quietly recognized.
The old minister, Hajji Mirza Aghasi, shut himself up in the royal palace with 1200 followers, arid had to take refuge in the sanctuary of Shah Abdul- Azim near Teheran.