In 1714, David Bek supported Vakhtang VI of Kartli in his struggle against the Lezgins, after which the people of Artsakh recalled David Bek from Georgia. He headed the Artsakh Military Council. David Bek appointed prominent commander Mkhitar a sparapet.
Ter-Avetis, Parsadai, Toro, and Karabakh meliks Yegan-Melik Avankhanyan and Avan-Yuz-bashi Babanyan became commanders of military units. David Bek, being soon proclaimed ruler of the independent principality of Syunik, directed his troops to Chavidur where he arranged his residence.
From 1722 to 1725, with the support of Mkhitar Sparapet, David Bek led the armed struggle of Armenians of Syunik and Artsakh against the Shahs Iran, which resulted in the almost complete expulsion of the Kizilbash groups and Persians from Eastern Armenia.
In 1726-1728, Armenians led by David Bek fought against the Turks who were trying to seize Transcaucasia. David Bek and his troops took one Turkish fortress after another. During the siege of Halidzor, David Bek defeated the twenty thousand strong Ottoman army. But already in the spring of 1725, a large Turkish army occupied Arran and Dagestan and then surrounded Artsakh and Syunik.
After numerous battles, David Bek reinforced his positions in the fortress of Halidzor. On the seventh day of unequal battles, Armenian soldiers, having left the fortress at night, unexpectedly attacked the enemy, who, in panic and suffering heavy losses, fled.
After the brilliant victory at Halidzor, David Bek pursued the enemy troops. The Turks received a new heavy blow in the summer near the village of Meghri, where they were again defeated. As a result, the Iranian Shah Tahmasp II recognized the authority of David Bek in Syunik and concluded an alliance with him against the Turks.