David IV

David IV, also known as David IV the Builder (დავით IV აღმაშენებელი) (1073–1125), of the Bagrationi dynasty, was the 5th king (mepe) of the Kingdom of Georgia from 1089 until his death in 1125.

Popularly considered to be the greatest and most successful Georgian ruler in history and an original architect of the Georgian Golden Age, he succeeded in driving the Seljuk Turks out of the country, winning the Battle of Didgori in 1121. His reforms of the army and administration enabled him to reunite the country and bring most of the lands of the Caucasus under Georgia's control. A friend of the Church and a notable promoter of Christian culture, he was canonized by the Georgian Orthodox Church.

Sobriquet and regnal ordinal
The epithet aghmashenebeli (აღმაშენებელი), which is translated as "the Builder" (in the sense of "built completely"), "the Rebuilder", or "the Restorer", first appears as the sobriquet of David in the charter issued in the name of "King of Kings Bagrat" in 1452 and becomes firmly affixed to him in the works of the 17th- and 18th-century historians such as Parsadan Gorgijanidze, Beri Egnatashvili and Prince Vakhushti. Epigraphic data also provide evidence for the early use of David's other epithet, "the Great" (დიდი, didi).

Retrospectively, David the Builder has been variously referred to as David II, III, and IV, reflecting substantial variation in the ordinals assigned to the Georgian Bagratids, especially in the early period of their history, owing to the fact that the numbering of successive rulers moves between the many branches of the family. Scholars in Georgia favor David IV, his namesake predecessors being: David I Kouropalates (died 881), David II Magistros (died 937), and David III Kuropalates (died 1001), all members of the principal line of the Bagrationi dynasty.

Family background and early life


The year of David's birth can be calculated from the date of his accession to the throne recorded in the Life of King of Kings David (ცხორებაჲ მეფეთ-მეფისა დავითისი), written c. 1123–1126,  as k'oronikon (Paschal cycle) 309, that is, 1089, when he was 16 years old. Thus, he would have been born in k'oronikon 293 or 294, that is, c. 1073. According to the same source, he died in k'oronikon 345, when he would have been in his 52nd or 53rd year. Professor Cyril Toumanoff gives 1070 and 24 January 1125 as the dates for David.

According to the Life of King of Kings David (ცხორებაჲ მეფეთ-მეფისა დავითისი), written c. 1123–1126, David was the only son of King George II of Georgia (r. 1072–1089). The contemporaneous Armenian chronicler Matthew of Edessa mentions David's brother Totorme. The latter, according to the modern historian Robert W. Thomson, was his sister. The name of David's mother, Elene, is recorded in a margin note in the Gospel of Matthew from the Tskarostavi monastery; she is otherwise unattested. David bore the name of the biblical king-prophet, whose 78th descendant he was claimed to be.

Through his father, David had ancestors among the most prominent dynasties of the Caucasus. David's grandfather was King Bagrat IV of Georgia and his grandmother was an Alan princess Borena. Besides he had in-law relations with the Byzantine Empire. David's paternal aunt Marta-Maria was a consort of the successive Byzantine Emperors Michael VII Doukas and Nikephoros III Botaneiates.

David's father, George II, was confronted by a major threat to the kingdom of Georgia. The country was invaded by the Seljuk Turks, which were part of the same wave which had overrun Anatolia, defeating the Byzantine Empire and taking captive the emperor Romanos IV Diogenes at the battle of Manzikert in 1071. In what the medieval Georgian chronicle refers to as didi turkoba, "the Great Turkish Invasion", several provinces of Georgia became depopulated and George was forced to sue for peace, becoming a tributary of the sultan Malik-Shah I in 1083 when David was 10. The great noble houses of Georgia, capitalizing on the vacillating character of the king, sought to assert more autonomy for themselves; Tbilisi, the ancient capital of Kartli, remained in the hands of its Muslim rulers, and a local dynasty, for a time suppressed by George's energetic father Bagrat IV, maintained its precarious independence in the eastern region of Kakheti under the Seljuq suzerainty.

Accession to the throne
David grew up in times of war and desolation, due to the ravages of the Seljuks and his father's numerous defeats against these invaders. Faced with such a situation, significant opposition arose against King George II and led to a change of power for the benefit of young David; George of Chqondidi would have been one of these opponents.

The Life of King of Kings David does not recount the details of the transfer of power between George II and his son. Nodar Asatiani describes the event as a “palace revolution” involving several dignitaries in 1089. Other historians speak rather of pressure on the Georgian king with a view to his abdication instead of a coup d'état. The contemporary chronicler of David IV limits himself to mentioning the change of power as a coronation of the young prince by his father, which pushes certain historians like Cyril Toumanoff to suggest a co-reign between George II and David IV, at least until 1112, while frescoes found in the Ateni Sioni Church represent him in monk's clothing, which would mean that his abdication was forced. The historical tradition founded by Prince Vakhushti in the 18th century and followed by Marie-Félicité Brosset in the 19th states that David succeeded George upon his death, a number of surviving documents suggest that George died around 1112, and that although he retained the royal title until his death,  he played no significant political role, real power having passed on to David. Moreover, David himself had been a co-ruler with his father sometime before his becoming a king-regant in 1089; a document of 1085 mentions David as "king and sebastos", the latter being a Byzantine title.

The arrival to power of David IV was welcomed by several factions of the country as a liberating sign of the Kingdom of Georgia, suffering politically, economically, culturally and even religiously.

Revival of the Georgian State
Having become King at the age of 16, the young David IV found himself at the head of a kingdom having lost a large part of its initial territories of 1010. The Kingdom of Georgia, extending at the beginning of the 11th century from Shirvan to the eastern coast of the Black Sea, is now limited to Abkhazia and Kartli. The seasonal devastation caused by Turkish raids since the 1080s constituted an economic danger for the country, which was forced to recognize itself as a vassal of Seljuk Empire and pay tribute to the invaders. Internally, the foundations of the Georgian state, based on orthodoxy and central royal power, are being undermined, bringing a supposedly unified kingdom to the brink of destruction. Several historians compare the task of the young sovereign to that of David III of Tao and Ivane Marushisdze, the princes who unified the Georgian realm.

The end of the Turkish ravages
The first step taken by David IV to restore the Georgian economy was the cessation of Turkish raids into Georgia. Since 1080 and the capture of Kutaisi by Emir Ahmed, the kingdom of Georgia was forced to accept Seljuk suzerainty and pay an annual tribute. Despite these measures, however, the Muslims did not stop their seasonal devastation and several Turkish nomadic tribes established themselves in Georgia at the expense of the Georgian population, causing the collapse of the local feudal system. Contemporary historiography reports that at the advent of David the Builder, inland Georgia no longer had a rural population, the inhabitants all having taken refuge in local citadels.

To expel the Turks from his territories, King David begins by reorganizing an army whose morale is at its lowest due to its numerous defeats; he then formed several small military detachments composed of the lower nobility and peasants coming from the royal domains. Soon, dozens of such detachments were created and a new strategy, consisting of surprise attacks on Muslim settlements, was developed. In some time, the monarch managed not only to stop the Seljuk incursions, but at the same time attacked the Turkoman nomads.

An armistice is soon established between the Georgians and the Turks. Under the terms of the treaty, David IV agreed to honestly pay the tribute established under his father's reign in exchange for a total cessation of Seljuk raids. This did not, however, stop certain Turks, whose troops were massacred by Georgian units, while the Turkomans established in the countryside were gradually expelled from the country, allowing the Georgians to return to their villages. Little by little, the conditions of local social life improve, reviving the national economy and increasing the population. By 1099 David IV's power was considerable enough that he was able to refuse paying tribute to the Turks.

Relations with the Byzantine Empire
Since the creation of the Kingdom of Georgia and its beginnings as a regional power in the Caucasus during the reign of Bagrat III (1010-1014), the Byzantine Empire and Georgia have repeatedly clashed both diplomatically and militarily, particularly regarding the province of Tao-Klarjeti. In this context, in addition to several wars between the two countries, each of these states interferes in the internal affairs of the other by openly or secretly supporting candidates for the throne, usurpers or, in the case of the Byzantine strategy, nobles recalcitrant against the power of the king.

Despite several peace proposals over the years, it was not until the Battle of Manzikert (1071) between the Byzantines and the Seljuk Empire that Byzantine Empire and the Kingdom of Georgia joined forces against the Seljuks. But this alliance could hardly be felt politically due to the considerable weakening of the Byzantine Empire against the Seljuks, to whom Georgia had to submit. The liberation from Turkish suzerainty over the Caucasus in the 1190s, however, changed events and led David IV to pursue a new policy against Byzantium. This mixes closer cooperation, while putting itself on the same political level as the empire and opposing the Byzantines on certain subjects.

This is how bilateral relations resumed with the agreement between Byzantine Empire and David IV, according to which the noble rebels against the Georgian king were sent to prison in Greece. At the same time, David definitively renounced Byzantium's political influence in Georgia by denying the Byzantine title of panhypersebastos, a distinction created by Emperor Alexios I Komnenos (r. 1081-1118) for the family's closest allies. Additionally, the Georgian monarch decided to support the rebel Theodore Gabras, who attempted to establish an independent state in Trebizond in 1091 and was married to David IV's aunt, Mariam. Finally, from the reign of David the Builder, Byzantine Empire and Kingdom of Georgia clashed spiritually, with King David taking the title "ruler of the East and the West", thus claiming to have greater influence than Byzantium in Orthodoxy.

Despite these signs, relations between Byzantium and Georgia also reached good levels. Thus, the marriage of David IV's daughter, Kata, to an imperial prince in 1116 is particularly notable. Some Georgian historians also note the assistance provided by Georgian agents accompanying Princess Kata's retinue in John II Komnenos' takeover in 1118. This is why from the beginning of the reign of John II, relations between the two countries improved considerably and the Georgian Chronicles nicknamed the two monarchs “brothers”. And, despite the competition in the religious field, the Byzantines and the Georgians cooperated culturally for a certain period and we can thus see religious buildings constructed by bilateral efforts, such as the major renovation of the Mokvi Cathedral (Abkhazia).

David IV and nobles
After putting an end to Turkish incursions and reestablishing the traditional feudal system, David IV decided to strengthen central power before embarking on more important projects. Indeed, just after the recovery of the Georgian economy, a large part of the nobility, including duke Liparit V of Kldekari and Prince Niania Cakhaberisdze, pledged allegiance to the king. This act then represents a remarkable change in the face of the reactions of noble society towards previous kings, but remains ephemeral.

In 1093, Liparit V, possibly converted to Islam, organized a plot against David. He was informed of this and reacted by imprisoning the eristavi to make him a “wise man”, according to the Georgian Chronicles. Two years later, he was released on bond and resettled in his estates of Trialeti and Kldekari. However, the noble does not abandon his plans against his overlord and begins plotting against Georgian kingdom again. Having once again learned of such an event, David IV decided to act more usefully and imprisoned him again until 1098, before permanently exiling him to Byzantine Empire. After the death of Liparit's son Rati, David abolished their duchy of Kldekari in 1103.

Liparit is not the only great noble to have suffered the consequences of the king's plans. Several others, notably Dzagan Abuletisdze, were similarly severely punished after rebellions, and their domains added to the royal estates. Thus, David takes important initiatives to strengthen his power. He also dismissed the dignitaries chosen by his predecessors because of their titles and replaced them with loyal advisors generally from the lower nobility.

Conquest of Kakheti-Hereti
After reducing the power of the great rulers, King David IV decided to complete national unity. To achieve this, he had to reunite western Georgia with the rest of the country. Indeed, the Kingdom of Kakheti-Hereti had declared its independence during the reign of George I (r. 1014-1027), thus depriving Georgia of a large part of its territories. Realising that only war could help him in his plans, the king launched a short attack against King Kvirike IV (r. 1084-1102) and succeeded in capturing the fortress of Zedazeni, north of Mtskheta, in 1101.

Kvirike IV died a year later and was succeeded on the throne by his nephew Aghsartan II, who is said to have been "the complete opposite of his paternal uncle". A convert to Islam, he declared himself a vassal of the Seljuk Empire to avoid another Georgian attack. However, he could not foresee the discontent of the nobility in his own country, who were unhappy with their sovereign's change of religion. In 1104, a plot led by the Heretian nobles Arishiani, Baram and their uncle Kavtar Baramisdze dethroned Aghsartan II and handed him over to David IV, who then had no need to resort to arms, as every Kakhetians citadel and fortress capitulated to the approaching Georgian forces. Once the two new provinces had been integrated into the kingdom, the king appointed Arishiani as the governor of the region.

The Seljuks, who still considered the Kingdom of Kakheti-Hereti to be their vassal, were not resigned to another defeat at the hands of the Georgians. The death of Sultan Malik-Shah I and the Pope's call to the Crusade against the Turks had already enabled David IV to challenge Muslim vassalage by ceasing to pay the annual tribute introduced in 1080. Thus, the Atabeg of Ganja declared war on Georgia and fought a decisive battle at the Battle of Ertsukhi. The Seljuk army was annihilated by the Georgian troops, personally led by David IV, whose exploits are recounted in the Georgian Chronicles. His chronicler compares the bravery of David IV to the biblical David and reports the ferocity of his blows. Three of his horses died during the battle, but the monarch, mounted on his fourth horse, succeeded in drawing with his sword "a thickened and congealed mass of blood".

Domestic reforms
After restoring the unity of the Kingdom of Georgia, David IV began to reform the internal state again. For this purpose, in 1103(or 1105) he convened a council of the Catholicos-Patriarch of All Georgia in the cathedrals of Ruisi and Urbnisi. Indeed, for decades of devastation and war, the Orthodox Church had lost its traditional values and suffered from numerous ills such as corruption or the hereditary transmission of high religious functions. Inspired by the ideas of the 11th century monk George the Hagiorite, the king and his advisor George of Chqondidi aligned themselves with the demands of the majority of his subjects to defeat the reactionary part of the ecclesiastical class and replace the subjects dishonest by virtuous priests. The Council of Ruisi-Urbnisi, led only indirectly by David IV who, as a secular sovereign, could not take part in the internal affairs of the Church, adopted resolutions reflecting the will of the pious party. This act is considered a major event in Georgian history. Indeed, not only did the council deprive the nobility fighting against the central power of an influential ally, the Church, but it also spiritually purified the kingdom and greatly contributed to the national consolidation of a country whose national identity is mainly based on Christianity.

Another consequence of ecclesiastical reform was the de facto subordination of the Church to the State. However, the king had to ensure this by taking further steps towards reform. Thus, David IV decided to centre this plan around the function of a single man: the Mtsignobartukhutsesi. This position, equivalent to the dignity of chancellor, had existed for a long time in the Georgian royal court and had always been held by monks, to avoid a hereditary transfer of power. The reform of David IV thus combined the Mtsignobartukhutsesi with the bishopric of Chkondidi, the main religious entity in Georgia after the Catholicos-Patriarch, and created the new position of Mtsignobartukhutsesi-Chkondideli, i.e. the first person in the kingdom after the king and the first person in the Church after the Catholicos-Patriarch. George of Chqondidi, the monarch's political adviser, was thus confirmed in his position, and his successors to the episcopal see were also appointed viziers at the royal court. Other officials reporting to the king were also appointed to head each branch of the administration. Thus, from the reign of David IV, there was a Mandaturtukhutsesi, or minister of the interior, an Amirspasalar, the head of the military administration, and a Mechurchletukhutsesi, the minister of finance and administrator of the kingdom's cities.

The king's reforms did not stop at the country's administrative system. At the same time, he set up the darbazi (High Council of State), which included the highest dignitaries of the Church, such as the Catholicos-Patriarch and the superiors of the major monasteries, and the Saadjo kari (literally, "Court of Petitions"), a kind of Supreme Court headed by the Mtsignobartukhutsesi-Chkondideli to "defend the oppressed and humiliated" and to which the king personally came to dispense justice. Finally, the king's reforms ended with a change in the military establishment.

Under Kings Bagrat IV and George II, the general decline in the economy had been accompanied by a significant fall in the population and an increase in the arbitrariness of the great feudal lords, leading to a deterioration in the quality of the Georgian army by undermining the discipline of the troops. David IV, considering the future wars he would have to wage against the Muslims, therefore decided to use the military organisation of the Seljuk Turks as a basis for reforming his own army. David IV began by gathering together his most loyal warriors to form a personal guard, the monaspa, which was entirely and directly dependent on the king. In addition, the feudal militias were abolished, once again reinforcing central power. In addition to these measures, the king divided the army into two other fundamental parts: one consisting of garrisons charged with protecting towns and fortresses, and the other making up the basic army that "campaigned constantly, both in winter and summer". Troop discipline was also ensured through humiliation for cowardice and rewards for heroism. What's more, as the economy recovered, the Georgian population grew and the royal authorities were able to mobilise on a larger scale.

The reconquest of lost territories
In 1110 the Georgians led by George of Chqondidi, his nephew Theodore, Abuleti and Ivane Orbeli, retaliated against the Seljuk settlement and recaptured the town of Samshvilde, which was added to the royal domains, without a major battle. Following this capture, the Seljuks left a large part of their occupied territories, allowing Georgian troops to capture Dzerna.

Responding to this double defeat, Sultan Muhammad I Tapar in 1110, sent a large army of 200,000 or 100,000 (or only 10,000 according to the Armenian version of the Georgian Chronicles) soldiers with the aim of invading Georgia. Knowing of the approach of Turkish troops, David IV left his home at Nacharmagevi with a personal guard of only 1,500 men and set out to meet the invaders during the night. The two armies, clearly unequal, clashed the next day at the Battle of Trialeti in a hard fight which ended in a decisive victory for Georgia. The Georgian Chronicles relate that, not believing in such a simple victory, the king remained there until the next day, waiting for a new Seljuk response, and only then realized the Seljuk defeat.

The Battle of Trialeti deprived the Seljuk Empire of the opportunity to conduct a major military campaign against Georgia for several years, and for the next 11 years, until the Battle of Didgori the Seljuks did not organized a campaign against Georgia. In 1110-1114, David IV did not conduct active military operations either. In 1115 while David IV was in Mukhrani, George of Chqondidi who commanded the Georgian forces captured Rustavi, one of the strong Seljuk strongholds in southern Georgia.

In February 1116 by the order of the king, the army of Kartli and Meskhetians were gathered at Klarjeti, David suddenly attacked and destroyed the Turks in Tao and captured Tao-Klarjeti and the numerous riches left by the Turks.

In 1117 David Captured the Gishi. Also in 1117 David sent his son, Prince Demetrius to Shirvan to fight, and the young commander astonished the people with his deftness in battle. Demetrius seized Kaladzori Castle and returned home with many captives and much wealth.

in 1118 Beshken II Jaqeli a Georgian nobleman who ruled the Javakheti was killed by the Seljuks in Javakheti, David heard from Nakhiduri the story of the Seljuks invasion of Javakheti and killing of Beshken Jaqeli. David refused to listen to his nobles' advice to retreat and managed to avenge Beshken's death by defeating the Seljuks at the Battle of Rakhsi and massacred the Seljuk garrisons on Araxes in April 1118.

The successes of the reforming sovereign did not end there. Indeed, still in 1118, the Armenian fortress of Lori and Agarak were captured by David IV, inaugurating the beginning of the conquest of Armenia by medieval Georgia, while the region of Agarani was recovered in July of the same year, after a single day of combat. Bagrat IV, David's grandfather, had taken three months to capture Agarani in the previous century. It was after this victory at Agarani that David IV and George of Chqondidi went to North Caucasus, understanding that despite the encouraging signs of a total defeat of the Seljuk forces, the Georgian army must be considerably reinforced to achieve this goal. The royal administration, now led by Simon of Chqondidi since the death of George, devoted the year 1119 exclusively to establishing a new strategy against the Turks, while establishing the Kipchak mercenaries on Georgian territory, before launching a new offensive as early as the beginning of 1120.

Negotiations with the North Caucasus
The foreign relations led by King David the Builder are exclusively devoted to the liberation of the Kingdom of Georgia and, in this way, remain focused on the Georgian–Seljuk wars. However, David IV soon understood that the Seljuk Empire remained a permanent threat to his kingdom as long as the security of the Caucasus against Muslim invaders was not assured. To this end, the monarch developed a plan aimed at the unification of the Caucasian peoples under his scepter. Assisted by his closest advisors, the Georgian sovereign began by establishing solid relations with the numerous tribes of North Caucasus and beyond the Greater Caucasus.

Already shortly after his divorce in 1107/1108 from the Armenian princess Rusudan, David IV married the daughter of the Kipchak khan Otrok, who was soon baptized under the name Gurandukht. However, this alliance did not last and no sign of bilateral relations appeared during the following decade. But soon, as Georgia began its new campaigns against the Seljuks, the king did not hesitate to appeal to his father-in-law for military aid. Indeed, the Kipchaks were then renowned in the region for their bravery, agility and ferocity in combat, but were also caught in a conflict on two fronts, one being against Kievan Rus' to the north and the other against the Alans to the south. David therefore offers khan Otrok assistance against these two enemies in exchange for Kipchak support against the Turks and decides to go to the domains of this khan.

Accompanied by his faithful advisor George of Chqondidi and his personal guard, David IV crossed the Greater Caucasus via the Darial Gorge in 1118. After significant negotiations, the Georgians managed to convince Otrok to donate several thousand Kipchak troops to fight against the Seljuks. But despite this agreement, the Kipchaks were unable to reach Georgia due to the war against the Alans. The latter not letting David IV return to his kingdom with the reinforcements, the Georgian monarch personally led a campaign against Alania, quickly took all the fortresses of the country and forced the Alans to swear allegiance to him. Taking both Ossetian and Kipchak hostages, he managed to negotiate a lasting peace between the two peoples and returned to the kingdom of Georgia with nearly 40,000 Kipchak families (nearly 200,000 individuals), led by Otrok, after having recovered and secured the fortresses of the Greater Caucasus, but leaving behind George of Chqondidi, who died during the negotiations in Alania. The numerous Kipchak families settled in colonial settlements in interior Kartli, where a large part of the Georgian population had been exterminated by the Seljuks, but also in Hereti and in the north of Georgian Armenia, in the aim of strengthening borders. They are also accompanied by Alanian, miserly and Kurdish mercenaries. Soon, they adopted Christianity, learned the Georgian language, changed their nomadic habits and settled down, and gradually mixed with the Georgians. The central power then asked each family to provide at least one soldier to the Georgian army. However, the Kipchaks, who are hardly accustomed to a sedentary life and loyal to a single character, find themselves in a new landscape which they take to be hostile. This is how, until his death, David IV survived several assassination attempts and coups organized by certain Kipchak groups. But this hardly changes the situation of the new arrivals and thanks to these negotiations, the reform of the army is completed and the Georgian troops now number nearly 60,000 men.

In addition to this alliance between the Kipchaks and Georgia, David the Builder maintained deeper relations with other North Caucasian peoples. He created a sphere of cultural influence in the Nort Caucasus, established Orthodoxy there by sponsoring the construction of Georgian churches among local peoples, and developed the economies of these peoples by participating in the founding of urban communities and the introduction of the system feudal Georgian in the region. Moreover, Georgian culture became an integral part of local organized societies, with Georgian and social terminologies of Georgian origin being introduced. Politically, David IV decided to strengthen the influence of his kingdom in the North Caucasus by making regional sovereigns his vassals and by controlling the routes leading from South Caucasus to North Caucasus via the Greater Caucasus mountain range. Thus, he fortified the passages of Darial and established Georgian counters on the road leading to Derbent, whose sovereign swore allegiance to the king of Georgia.

Battles to drive out the Turks


In 1120 David got into the habit of going to Abkhazia and the Seljuks were wintering near the banks of Mtkvari. David first moved to Geguti, and from there to Khupati. The Seljuks found out how far it was, they camped at Botora. The Seljuks set up camps to spend the winter. On February 14, David suddenly attacked the Seljuks and completely destroyed them at the Battle of Botora. Only a few of them managed to get on their horses and run away. In the battle the Georgians captured many Seljuks and gained a lot of booty.

Only two months later, David IV again led his troops to intervene in Shirvan: after capturing the city of Qabala and returning to Georgia with large loads of gold, he returned to the region on May 7, 1120 and ravaged the country from Arbia-lizhatat to Khishtalanti and Kurdevan. 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 the king of Georgia the opportunity to place his own son-in-law and vassal, Manuchihr III, in Shirvan. At the same time, David the Builder led short but effective campaigns in the southeast and notably took the Turkish bastions of Arsharunik and Sevgelamej.

Taking advantage of the climatic conditions which had until then worked against them, the Turks in turn organized a large-scale offensive against Georgia in winter 1120-1121. Indeed, at that time, David IV resided in Abkhazia in his winter home and the Turkish strategy therefore lay in a rapid invasion of central and eastern Georgia. Soon, Seljuk forces occupied much of Kartli, as far as the Greater Caucasus. However, King David, having learned of the situation in the rest of his kingdom, rushed out of Abkhazia and ordered his soldiers to dig a passage through Likhi Range, then impassable and thus separating eastern Georgia from its part Western. The Georgian troops attacked Khunan and engaged in bloody combat until the spring, and all the Turkish forces were expelled or massacred in March 1121.

But the Seljuks did not stop there. Knowing that the flooding of the Mtkvari made crossing the river almost impossible at this time of year, the Seljuks soon returned to their positions south of the river and occupied Barda. But once again, David IV, accompanied by a personal guard of Kipchaks, crossed the river towards Khunan and organized military incursions against the Turks stationed at Barda and Arabia in June. The Muslims, according to Georgian historiography, were then “reduced to the brink” by a long series of costly defeats for more than ten years.

Battle of Didgori
Shortly after the double defeat of Barda and Arabia, the Turkish settlers of South Caucasus and the Muslim merchants of Ganja, Tbilisi and Dmanisi sent representatives to the Seljuk Sultan of Iraq Mahmud II (r. 1118-1131), formally requesting military support against the Georgian forces. The Muslim monarch, fed up with the victories won by an increasingly powerful Christian kingdom while the Crusaders already found themselves powerful enemies of the Turks in the west, then declared jihad (holy war of Islam) against Georgia and unifies a large Turkish army with detachments formed by the Seljuks of Turks coming from all over the Middle East (from Damascus and Aleppo to Caucasus) with: Tughril a Seljuk cadet who governs Azerbaijan and Arran from Nakhchivan, Arab forces of the Mazyadid emir Dubays ibn Sadaka, troops led by Najm ad-Din Ilghazi ibn Artuq from Aleppo, and garrisons from Ganja and Armenia, with the aim of invade the Kingdom of Georgia. Mahmud II also appointed General Ilghazi, famous for his battles against the Europeans in the Holy Land and having concluded a temporary truce with the crusading Latins, as commander of these massive Muslim troops, whose numbers rose, d 'according to the sources, from 200,000 to 400,000 or even 600,000 soldiers.

Having learned of the declaration of jihad by Mahmud II, David IV understood that the defeat of such an army would lead to the total liberation of the Caucasus and, therefore, the completion of the political goal of the Georgian ruler. In turn, he assembled a large army, composed of 40,000 Georgians, 15,000 Kipchaks and 5,000 Alans (60,000 troops in total), to which was added a detachment of 200 to 1,000 Crusaders from Western Europe. The king decided to let the Turks penetrate into Georgia proper, with the idea of benefiting from the local geography, and finally intercepted the enemy on the roads linking Trialeti to interior Kartli. The two armies met near the town of Manglisi, at the foot of Mount Didgori, on August 12, 1121.

According to the French knight and historian Walter the Chancellor, before heading off to battle, King David inspired his army with these words:

“Soldiers of Christ! If we fight bravely for our Faith, we will defeat not only the devil’s servants, but the devil himself. We will gain the greatest weapon of spiritual warfare when we make a covenant with the Almighty God and vow that we would rather die for His love than escape from the enemy. And if any one of us should wish to retreat, let us take branches and block the entrance to the gorge to prevent this. When the enemy approaches, let us attack fiercely!”

The king personally launches the attack, rushing his troops towards the attackers with a ferocity comparable to that of a "rambling monster". From the first attack, the Muslims were forced to retreat despite their numerical superiority, allowing the Georgians to multiply such attacks. Soon, these maneuvers bring the enemy to such a degree of excitement and disorientation that they make him lose composure. At this moment, David IV launched a new attack, which turned into a coup de grace for the Muslim allies on the battlefield: suddenly, the vigor of the enemy army collapsed in the middle of the fight. The genius of Georgian strategy then defeated the power of numbers, bringing a decisive defeat to the Seljuk Empire and its influence in the Caucasus. Testimonies report in various chronicles, both Christian and Muslim, that Saint George personally led the Georgian forces against the invader. Among the many commanders of the invading troops, only General Ilghazi and his son-in-law Dubays managed to escape. This victory at the Battle of Didgori had an important repercussion on the fate of the Crusades, whose leaders were then seeking crucial aid against the Turks, and stories, sometimes exaggerated, of Didgori's victory were told in the royal courts of the West as a new hope against Muslim power.

Relations with the Middle East
Besides Europe, David IV established relations with the Middle East. This is how he maintained close relations with the Crusader forces, and in particular with King Baldwin I of Jerusalem (r. 1100-1118), with whom he exchanged numerous gifts as a sign of support. In addition, as stated above, a battalion of Latins composed of 200 to 1,000 men participated during the Battle of Didgori. Some sources also speak of the participation of Georgian auxiliary forces during the Siege of Jerusalem in 1099. The historian Prince Ioane of Georgia even reports a secret visit by King Baldwin II of Jerusalem to the Georgian royal court. The existence of a powerful Kingdom of Georgia is also felt in the Arab world, where the Georgian monarch's kindness to his Muslim subjects and his knowledge of the Quran are renowned. A coin with the Arabic inscription “King of Kings David, the Sword of the Messiah” then circulated throughout the Middle East.

Liberation of Tbilisi
The defeat of the Seljuk Empire at the Battle of Didgori in August 1121 allowed David IV to liberate the Caucasus from Muslim domination dating back several centuries. Georgia's enemies found themselves decisively defeated, preventing them from retaliating against the northern Christian advance, while the Crusades raged in the west of the Turkic world. However, there remains a last Islamic enclave within the Georgian kingdom, an enclave having lost all relations with other Muslim states since the start of King David's conquests. This corresponds to the Emirate of Tbilisi, which had been occupied by the Arabs for almost five centuries, and contains the regions of Tbilisi and Dmanisi.

Already in June 1121, David IV had put the city of Tbilisi under siege but was content with a formal allegiance with an annual tribute, in view of the upcoming war against the Turkish invaders. Once the Seljuks were defeated, the sovereign focused on the capture of Tbilisi from the beginning of 1122. After a short siege, the king, probably accompanied by general Ivane Orbeli, managed to take the city in February and enters it to rid it of the Muslim elite. According to Arab historiography, David IV carried out a pillage on the first day of the conquest, devastating the mosques and other signs of the Islamization of the Georgian city, but soon calmed down. and, in the words of the 15th-century Arab historian Badr al-Din al-Ayni, "respected the feelings of Muslims more than Muslim rulers had done before."

Following the capture of the city, the king transferred the capital from Kutaisi to Tbilisi, thus restoring the latter to the status it had before the Arab conquest of the 7th century. The recovery of Tbilisi guarantees a cultural renewal in the city, whose Christian religious buildings are being enlarged. David the Builder also built several noble palaces and cultural centers, such as an important palace built especially to serve as a place of study and inspiration for Muslim poets. However, the situation in the city has not calmed down. During the following years, several bloody clashes between Muslims and Christians occurred, and even the royal power failed to calm inter-religious dissensions. At the same time, David IV decided to preserve some of the institutions of the former emirate of Tbilisi. Thus, the post of emir was retained, but as governor of the city, until the 18th century.

Despite this conquest, the Muslim enclave, whose territory was greatly reduced following the loss of its administrative center, persisted in the middle of the Georgian kingdom. David IV finally decides to put an end to the existence of this State, just after having “settled the affairs of the country”. In March 1124, he managed to attack the last Muslim stronghold in Georgia, Dmanisi, which he took after a short fight, thus completing the unification of Georgia.

Conquest of Shirvan
The resumption of Tbilisi by David the Builder ebuilder therefore established the kingdom of Georgia as the supreme protector of Christianity in the Caucasus and the Georgians now tried to assert their domination by trying to reduce the Muslim presence in the same region, this one being considered an ally of the Seljuk Empire. This is the case with Shirvan, whose sovereign, already defeated several times by Georgian troops, remained too independent of Georgian power and was forcibly replaced by a son-in-law of David IV, Manuchihr III, in 1120. The Turks, alarmed by the situation in Caucasus, then decided to respond militarily.

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 Tabriz, before reaching the local capital, Shamakhi, the following spring. Mahmud then captured the regional sovereign Manuchihr III and sent a letter to the king of the Georgians saying: "You are the king of the forests, and you never go down to the plains. Now I have taken Shirvanshah and I demand Kharaj [tribute] from him. If you wish, send me suitable presents; if not, come and see me in all haste.

Following this provocation, the Christian monarch 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 the king the opportunity to regain control of his vassal province if he would let him leave in peace, but the monarch categorically refused and resumed his march towards the Shirvan capital after defeating an army of 4,000 Seljuks led by the Atabeg of Arran. 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 defeat of the Seljuks, David IV invaded Shirvan, starting by capturing the town of Gulistan. He soon dethroned his own son-in-law, establishing him in Georgia and directly annexing the region. This act allows Georgia to reach its greatest extent since the beginning of its history. Indeed, for the first time Georgia extended from the Black Sea to the Caspian Sea and from the Greater Caucasus to Northern Armenia.

Georgian power on Caucasus
The resumption of Tbilisi and the conquest of Shirvan not only completed the long process of the unification of Georgia which began at the end of the 10th century, but henceforth gave the kingdom a regional reputation as protector of Christianity and brought different peoples of South Caucasus to ask for help from David IV against the Muslim forces. This fact further encourages the Georgian monarch, one of whose plans is to secure the entire Caucasus by establishing Georgian domination there, with a view to effective defense against the Turks. As seen above, the North Caucasus was already under the cultural and political influence of the Kingdom of Georgia at the start of the Georgian–Seljuk wars, while Derbent becomes a more or less faithful vassal of Georgia and Shirvan is forced to submit.

The conflict against the Crusaders in the Middle East was also one of the main factors breaking the backbone of Turkish power. This therefore allowed the king of Georgia to continue his momentum towards the south after the capture of Dmanisi, in particular towards the historic territories of Armenia. In May 1124, Georgian troops led by David the Builder entered southern Transcaucasia and within a few days captured many Armenian strongholds, such as the fortresses of Gagni, Teronakal, Kavazani, Norbed, Manasgonmni and Talinjakari. The following month, the king, after returning to Georgia proper, resumed his journey and crossed the Javakheti, Kola, Carnipola and the Basiani and destroyed all Seljuk installations there, before reaching the town of Speri, in Tao-Klarjeti. After this offensive, he continued his way into Tao-Klarjeti and burned Oltisi after taking Bouïatha-Qour.

Having learned of the liberation of the Christian cities by the king of Georgia, the nobility of the ancient Armenian capital, Ani, sent representatives to David IV on August 20, 1124, to the source of the Bojana. Indeed, Ani had been in Muslim hands since its capture by Alp Arslan in 1064 and a forced Islamization of the city had taken place since the sale of Ani to the Shaddadids, to the discontent of the local Christian population. The said representatives then offered the monarch the surrender of the city. Taking this opportunity in hand, David summoned all his armies and entered Armenia with 60,000 men to take the city. Without a single fight, the Armenian population of Ani opened the gates to the Georgians, who captured Emir Abu'l-Aswar Shavur ibn Manuchihr (r. 1118-1124) and exiled him and his family to Abkhazia. The region was then left to the governance of the Meskhetian nobility, to General Abuleti and his son Ivane. Armenian families (including many dispossessed nobles) subsequently established themselves in Georgia proper and the royal power built the city of Gori for them. Northern Armenia was thus annexed and incorporated into the Kingdom of Georgia, increasing the power of David IV in the region.

Georgia's conquest of Northeast Armenia finally completed the ultimate project of securing South Caucasus against the Turkish threat. For the first time, the entire Caucasus is unified culturally, spiritually and politically under a single scepter, this being Georgia. The written tradition relates the borders of the Georgian world of the time, describing it as going from "Nicopsia to Derbent and from Alania to Aragats", i.e. from one sea to the other, and from the North Caucasus to Armenia. The deliverance of North-Eastern Armenia in fact guarantees this power, reflected in the official title of the Georgian king: “King of Kings, of the Abkhazians, Iberians, Ranis, Kakhetians, Armenians, of Shaki, Alania and the Rus, Sword of the Messiah, emperor (basileus) of all the East, the invincible, servant and defender of God, the Orthodox king.

Despite his advanced age, David IV continued his military actions during the last years of his reign. For example, in April 1124, he took the town of Chabran after an attack against his vassal of Emirate of Derbent. Still in the region, after having defeated a North Caucasian army composed of Kurds, Lezgins and anti-Georgian Kipchaks, he captured the citadels of Ghasanni and Khozaond, during an obscure campaign north of the Caspian Sea. Another military campaign was organized in September in Shirvan, under obscure circumstances. The king managed to recover Shamakhi and took the citadel of Bigrit, before strengthening his power in Hereti and Kakheti by leaving strong garrisons of soldiers there. In January 1125, shortly before his death, David once again faced Muslim attackers, led by the Emir Ibrahim ibn-Suleiman. The latter, accompanied by Emir Davout ibn-Soukman of Hantzit, however failed to achieve a victory over the kingdom of Georgia and the Christian sovereign managed to massacre the invaders after five days of battle.

Death
[[File:Tomb_of_David_IV_of_Georgia_at_Gelati.jpg|thumb|The "Tomb of David IV" at Gelati reads:Ⴕ ႤႱႤႠႰႱႢႠႬႱႠႱႭႤႬႤ

ႡႤႪႨႹ[ႫႨ][ႭႩႨႭႩႤ][ႤႱႤ]ႫႧႬႠ

ႥႱႠႵႠႣႠႥႤႫႩჃႣႰႭႫႤ]] Subsequently, David IV began to organize plans for new large-scale campaigns for the coming spring. However, the weakness caused by his illness and his age prevented him from continuing this project and he was forced to let his Mtsignobartukhutsesi Simon of Chqondidi take care of the affairs of the country. The long reign of thirty-four years of David IV the Builder ended abruptly on January 24, 1125. The king died in his capital Tbilisi, after having appointed his eldest son Demetrius as successor, transmitting to him the Georgian royal attributes, consisting of a crown of precious stones, a scimitar and purple kneepads and sleeves. The king was buried, following his request, in the Gelati Monastery. His tomb is placed, again according to his will, at the main entrance of this religious building that he had built, so that anyone coming to his beloved Gelati Academy stepped on his tomb first.

Burial
A tombstone at the entrance of Gelati monastery, bearing a Georgian inscription in the asomtavruli script, has traditionally been considered to be that of David IV. Although there are no clear and reliable indications that David was indeed buried in Gelati and that the present epitaph is his, this popular belief had already been established by the mid-19th century as evidenced by the French scholar Marie-Félicité Brosset who published his study of the Georgian history between 1848 and 1858. The epitaph, modeled on the Psalm 131 (132), 14, reads: "Christ! This is my resting place for eternity. It pleases me; here I shall dwell."

Personal life
The Georgian Chronicles are an important source not only on the course of the reign of David IV the Builder, but also on the private life of the Christian king, reporting his activities and personality. According to these, David IV is a very pious king following Christian traditions, David IV spends his time informing himself, criticizing and learning several episodes from the Bible. According to his biographer, David IV learned to live according to the Christian religion from an early age and continued throughout his life. David himself composed, c. 1120, "Hymns of Repentance" (გალობანი სინანულისანი, galobani sinanulisani), a sequence of eight free-verse psalms, with each hymn having its own intricate and subtle stanza form. For all their Christianity, cult of the Mother of God, and the king's emotional repentance of his sins, David sees himself to be similar to the Biblical David, with a similar relationship to God and to his people. His hymns also share the idealistic zeal of the contemporaneous European crusaders to whom David was a natural ally in his struggle against the Seljuks. Furthermore, the Armenian version of the Chronicles indicates the name of the king's confessor (who knows Armenian), Hovhannes Imastaser of Haghpat.

David IV the Builder also engaged in important charitable activities. Indeed, he built hospitals in the country for the sick, which he took care of occasionally, as described in the chronicles:

"“He had yet another thought, following the example of the good God, gentle and merciful, loving men; it was to build a hospice, in a beautiful and suitable place, where he gathered his brothers afflicted with various illnesses, provided for all their needs, with generous lavishness and assigned income to meet their needs. He himself came to see them, questioned them, kissed them one after the other, lavished on them the tender care of a father, complimented them, encouraged them to be patient, arranged their clothes, their clothes with his own hands. beds, their mattresses, their dishes, and all their utensils; gave everyone abundant alms, animated their supervisors and put their affairs in the most beautiful order, following the spirit of religion. »"

The king has several residences across the country. The most important are the royal palaces of Kutaisi and Tbilisi, but David also has residences in Tsaghoulistavi and Abkhazia. It spends most of its winters until February in this latter region with a Mediterranean climate, notably in the coastal town of Bichvinta. During these stays, the kingdom is administered by its faithful general Theodore. David IV is also fond of hunting and has vast territories for hunting deer and wild boar in his domains of Kartli or Geguti. King David the Builder gave close attention to the education of his people. The king selected children who were sent to the Byzantine Empire "so that they be taught languages and bring home translations made by them there". Many of them later became well-known scholars.

David's chronicler claimed that "he knew the deeds better than any other king" because he was enthralled with theology, astrology, and history, and he brought his books with him on campaign. It seems that he read both Persian poetry and the Qur'an.

At the time of David the Builder there were quite a few schools and academies in Georgia, among which Gelati occupies a special place. King David's historian calls Gelati Academy "a second Jerusalem of all the East for learning of all that is of value, for the teaching of knowledge – a second Athens, far exceeding the first in divine law, a canon for all ecclesiastical splendors."Besides Gelati there also were other cultural-enlightenment and scholarly centers in Georgia at that time, e.g. the academy of Ikalto.

Family
Different sources mention David's two wives of whom one, unnamed, was an Armenian lady; the other, Gurandukht, a Cuman-Kipchak, is the only one who can be precisely identified.

David IV's children were:
 * Demetrius I of Georgia ( c. 1093–1156), King of Georgia (1125-1155, 1155-1156);
 * Princess Tamar (died after 1161), married Manuchihr III of Shirvan, and became a nun in widowhood;
 * Princess Kata, she was married off by her father into the Byzantine imperial family c. 1116;
 * Prince Zurab, otherwise unknown;
 * Prince George, there is a reference to David's other possible son "Gorgi" (George, Giorgi) in the 13th-century Armenian chronicle of Vardan Areveltsi;
 * Prince Vakhtang (1118–1138), he was involved in an attempted coup against Demetrius I, his half-brother and heir apparent;
 * Princess Rusudan, she was married into the family of Alan kings;

Legacy
Georgian historiography today portrays David IV as a king that few Georgian sovereigns can match. In fact, the majority of current historians agree to qualify David as the most prestigious Georgian monarch in history and make his reign the beginning of the Golden Age of the Kingdom of Georgia, an era which completed only under the reign of Rusudan (r. 1223-1245). According to his contemporary biographer, his actions earned him the title of Builder upon his death. It is notably celebrated by the poet Ioane Shavteli in his cycle of praise Abdulmesiani, jointly with Tamar.

David the Builder occupies a special place among the kings of the Georgian Golden Age in the period of the defense against the Seljuks. The "Order of David the Builder" is given to regular citizens, military and clerical personnel for outstanding contributions to the country, for fighting for the independence of Georgia and its revival, and for significantly contributing to social consolidation and the development of democracy.

The sovereigns succeeding David IV had great respect for him and his actions allowed him to maintain an international reputation for several decades: for example, while King Bagrat V (r. 1360-1395) was held captive by Timur, he offered the Turco-Mongol emir a coat of mail of precious work having belonged to David the Builder, following which Timur, appreciating this present, frees the king and makes him his favorite. More recently, the memory of David IV was revived in 1995 during the inauguration speech of Eduard Shevardnadze, who cited him with other kings as the builder of the Georgian nation. Furthermore, President Mikheil Saakashvili states that his role model is King David IV; in commemoration of the country's national unity, Saakashvili organized an inauguration ceremony in the Gelati Cathedral where he was blessed by the Catholicos-Patriarch of All Georgia Ilia II in January 2004.

The airport at Kutaisi is known as David the Builder Kutaisi International Airport. The National Defence Academy is named after him.

David IV of Georgia has several monuments, buildings and streets named after him across Georgia. The Russian-Georgian sculptor Merab Berdzenishvili built an important monument to David the Builder, which he offered to the municipality of Tbilisi. In addition, a university named after the former king was opened in 1991. One can also find an important avenue in the Georgian capital named after David IV of Georgia. A military decoration is finally dedicated to the Georgian king.

Furthermore, David IV of Georgia is considered a saint by the Orthodox Churches as well as by Western faiths. However, he was never canonized and his sanctification was the result of a historical and popular process. Cited as the protector of the Georgian nation, he is celebrated on January 24 in the West and January 26 in the East. Many churches currently bear his name, including a Georgian church dedicated in 2009 in Pennsylvania (United States).