The immediate ancestor of the Qajar dynasty, Shah Qoli Khan of the Quvanlu of Ganja (also spelled Ghovanloo or Ghovanlou), married into the Quvanlu Qajars of Astarabad. His son, Fath Ali Khan (born c. 1685–1693) was a renowned military commander during the rule of the Safavid shahs Sultan Husayn and Tahmasp II.