# Georgian conquest of Shirvan

The Georgian conquest of Shirvan was a military conquest of Shirvan by David IV the Builder during the Georgian–Seljuk wars.

## Conquest

Around 1112, David IV's daughter Tamar was given in marriage to the future Shirvanshah Manuchihr III. Despite this alliance, Afridun I probably continued to cooperate with Seljuks. In 1117 David sent his son Demetrius on a punitive campaign to Shirvan, and the young commander astonished the people with his deftness in battle. Demetrius seized Kaladzori Castle (later Alberd, now Agdash) and returned home with many captives and much wealth.
In 1120 David IV captured Qabala, returned to Kartli, quickly gathered an army and invaded Shirvan on 7 May and ravaged the country from Lizhata to Kurdevan and Khishtalan. At the same time, David IV managed to convince his vassal of Derbent to invade Shirvan and a war between the two parties soon broke out. In November, the Derbentians killed Shirvanshah Afridun I in combat, giving David IV the opportunity to place his own son-in-law and vassal, Manuchihr III, in Shirvan.
Sultan Mahmud II soon resumed the war against Georgia, despite his defeat at the Battle of Didgori a year earlier. In November 1122, he began his invasion of Shirvan and captured Shamakhi,. Mahmud then captured the Shirvanshah Manuchihr III and sent a letter to David IV saying: "You are a King of forests and will never be able to come out into the open; now I have captured Shirvanshah and demand kharaj from him for myself; if you want the same, send me some worthy gifts and come out of cover to see me".
Following this provocation, David IV called in all his troops and assembled an army of 50,000 men, most of them Kipchaks. The Seljuk sultan locked himself in Shamakhi after learning of the arrival of the Georgian troops, prompting David IV to halt his advance, deeming it disrespectful to pursue a retreating army. Mahmud II then offered David IV the opportunity to regain control of his vassal province if he let him leave in peace, but the Georgian king categorically refused and resumed his march towards the Shirvan capital after defeating an army of 4,000 Turks led by the atabeg of Arran, Aqsunqur Ahmadili, which was on its way to help Mahmud II. Once he had laid siege to Shamakhi, the Seljuk left the city in a hurry via the commune's excrement drainage system.
In June 1123, a month after the Seljuk defeat, David IV invaded Shirvan once again, he captured Gulistan, the residence of the ruler of Shirvan; he annexed Shirvan and handed innumerable gifts to all the people who were obedient to his will.
After the Siege of Ani, David IV allowed his troops to rest and then invaded Shirvan in September 1124. He captured Shamakhi and the fortress of Birit', the whole of Shirvan, and left Heretian and Kakhetian soldiers in the fortresses and towns. David IV completely freed Shirvan from the Seljuks and annexed the western Shirvan, handing its government over to Mtsignobartukhutsesi Simon, who at that time was the bishop of Bedia and Alaverdi. David IV left the eastern Shirvan to his son-in-law, Manuchihr III as a Georgian protectorate.
David IV's battles were of great importance both for Georgia and, especially, for Shirvan. The joint struggle of the Georgians and the people of Shirvan ensured the independence of Shirvan from the Seljuk conquerors. From now on, Georgia and Shirvan became closer to each other.

## Aftermath

In 1125 Manuchihr III, who was Demetrius I's brother-in-law, regained control of western Shirvan. And in 1126, the Muslim population of Shirvan rebelled with the support of the Seljuks. In 1129-30, Demetrius reached a compromise with the support of his sister, Shirvan was again divided into two parts, the Christian part was incorporated into Georgia and the border being the Tetritsqali (Agsu River), while Manuchihr was appointed as the emir of eastern Shirvan and recognized Georgia's vassalage.
The modern historian O. Vil'chevsky has posited that Tamar's return to Georgia was precipitated by a political turmoil in Shirvan that followed Manuchihr's death. Tamar found herself involved in a power struggle among her sons, favoring the younger, who joined her in an attempt to unite Shirvan with Georgia with the help of Kipchak mercenaries. Manuchehr's older son Akhsitan I was able to secure support from the Eldiguzids of Azerbaijan, winning the contest for the throne and forcing Tamar and his younger brother into flight to Georgia.