David resided at Qara Aghach or Qaraghaji in eastern Kakheti, on the borders of Shirvan, but had to move his residence to Telavi after he failed to recover Balakan from the Dagestani warlords and lost Qakh to them in 1706.
According to historians, the territory of Qakh was a part of the Scythian Kingdom in the 7th century B.C.