[2] According to Abbasgulu Bakikhanov, ancestors of the family migrated to Baku from Gilan, after certain "Khan Ahmad affair",[2] which probably means end of Malati ruler Sultan Ahmad Khan's reign.
[3] He claims ancestors of Baku khans were hailing from Nur and Kujur rulers ruling in Tabaristan, i.e.
Heybet beg's elder son Dargahqulu beg was a landlord in Mashtaga who seized the city and killed sultan who was appointed by Safavids, then began to call himself khan, appointing Selim khan as naib of Absheron.
He defeated forces of Surkhay khan of Qaziqumuq and later Haji Davud of Shirvan and extended his rule to Shabran and Gobustan.
Dargahqulu surrendered castle to Mikhail Matyushkin with 700 soldiers[5] in 1723[6] and was acknowledged by Russian Empire as local ruler.