The ruler of Kartli and Kakheti, Irakli II, sought to unite Georgia, took care of the education and development of the economy. Tried to create a regular army and maintain independence from Persia and Turkey. In the second half of the 18th century, a rapprochement between Russia and the Caucasus began. By the end of the century, Malaya and Bolshaya Kabarda, North Ossetia and other highland regions passed into Russian citizenship. In 1782, King Heracli II addressed Empress Catherine II with a request to take Georgia under the auspices of Russia. Weakened by internal disunity, Georgia was robbed even by the mountaineers of Dagestan, who bordered on Kakheti.
In 1783, the Georgievsk Treaty was concluded between Russia and Georgia, according to which Russia pledged to defend Georgia in the event of war, during negotiations to insist on the return of the possessions of Kartli and Kakheti, conquered by Turkey. However, only three years later, in 1786, Heraclius II concluded a separate peace with the ruler of Turkey Selim III.
In 1794, Aga-Mohammed Khan, the son of the leader of the Turkic Qajar tribe, seized power in Iran. In 6 years, the boy was defied by his father’s enemies and, as a result of ridicule due to this injury, the character of Aga-Mohammed Khan became cruel and ruthless. The new ruler set a goal to subordinate all the Transcaucasus to his power. In 1795, he attacked Georgia and ravaged Tbilisi. Five days the Persians were outraged in the city. Of the 60 thousands of inhabitants, only 5,5 thousands remained, most of the population was captured. Then king Heraclius II again turned to the Russian Empire for help.
Angered by the actions of the Shah of Persia. In 1796, Catherine II sent an expeditionary corps to Persia under the leadership of General-in-Chief Valerian Zubov, who was appointed commander-in-chief of the Caucasian Line. The Caucasian line was a small fortification along the bank of the Terek, guarded by the Cossacks. A participant in the Russian-Turkish war, Zubov was distinguished by his bravery and in a short time took the fortresses of Derbent, Cuba, Shemakha and Ganja, forcing the Shah to return to Persia. Petr Stepanovich Kotlyarevsky, a graduate of the commander of the Lazarev Chasseur Regiment, also took part in this campaign. However, the death of the Empress stopped the advance of the Russians in Transcaucasia. Emperor Paul I ordered the Zubov Corps to return to the border with Russia. The outgoing corps was again attacked by the Persians, but the unexpected death of Aga-Mohammed Khan in the 1797 year saved Georgia from ruin.
The death of King Heraclius II in 1798 year plunged Eastern Georgia into chaos. Due to the absence of a law on the succession between the numerous descendants of the king, a struggle for power broke out. The eldest son of Heracli II, George XII, won this fight, but he had no confidence in safety. The new king was a flaccid and seriously ill person. The younger brothers left no attempt to seize the throne and asked for help from Turkey, from Persia and the Highlanders of the Caucasus. So, Alexander joined the Avar leader Omar-Khan, who repeatedly raided Georgia. He gathered an army of Georgians, promising that the Avars would help him regain power and not ruin the Georgian lands. However, this was only a trick, since for Omar Khan, military booty was more important, and not the political intrigues of the Georgian kings.
George XII again turned to Russia for help. He asked Emperor Paul I to take Kartli and Kakheti into Russian citizenship and to give protection from the Turks and Persians. The commander-in-chief of the Caucasian line, General Karl Fyodorovich Knorring, received an order to render Georgia full support and sent there the 18-th (later renamed into 17-th) jager regiment under the command of General Lazarev. Lazarev Ivan Petrovich distinguished himself in the war with Sweden, then in the Caucasus - during the storming of the fortress of Anapa and the taking of the fortress of Derbent, after which he was promoted to general. His family died shortly before he was sent to Georgia, and Kotlyarevsky was the closest person for Lazarev.
At that time, Omar Khan approached the borders of Kakheti from Avarstan. He enjoyed great prestige in the mountains of Dagestan and could gather thousands of warriors who were ready to go with him anywhere. Omar Khan's allies always had warlike Lezgins. When General Lazarev found out about this, he decided to go out to meet the highlanders in order to prevent the plundering of Kakheti. He had only a little more than five hundred bayonets at his disposal. As a reinforcement, a Kabardian regiment under the command of General Vasily Semenovich Gulyakov was sent to Lazarev. During the reign of Catherine II, Gulyakov participated in the wars with Turkey and Sweden, and in 1800 he was appointed chief of the Kabardian regiment. The overall command of the Russian troops in eastern Georgia was transferred to General Lazarev. He decided to give battle to Omar Khan in the Alazani Valley. A Russian Georgian militia in the amount of 3 thousands of poorly armed men joined the Russian detachment. Omar Khan led with him to 15 thousands of mountaineers, for whom raids were considered the most respected craft. Unlike the regular army, the Avar Khan cavalry did not take either food supplies or fodder with them - all this was mined on the spot. For this purpose, Omar Khan distributed his army along the entire border with Kakheti, and General Lazarev could not know in advance where the highlanders would strike.
The army of Omar Khan descended from the mountains into the Alazani valley, crossed over to the right bank of the Alazan river and moved to the town of Karaagach. Learning of this, the generals Lazarev and Gulyakov led him to meet the united Russian-Georgian squad. 5 November 1800 of the year he took up a position six miles from the Highlanders' camp. An experienced Omar Khan did not want to take an open battle, and by night he walked around the Russian detachment at night, moving towards Tiflis. The generals began to pursue and overtook Khan 7 on November on the banks of the Iori River, near the village of Kagabeti. Lazarev built his soldiers in a square and Omar Khan had no choice but to accept the battle. Turning to the left bank of Iori, his cavalry from two sides fell upon the Lazarev detachment and met with a powerful rebuff. Omar Khan again attacked, this time aiming at the Georgian militias. They rushed scattered at the sight of thousands of horsemen, and General Gulyakov hurried to their aid. The cavalry of the Highlanders attacked several times, and each time the horses retreated, bumping into Gulyakova's square. They were frightened off by people with bayonets and gunshots. Lezgins were particularly insistent, but Omar Khan soon realized that he could not break through the Russian square. He signaled a retreat. The whole battle took 3 hours, the Russian victory was complete.
Here's how the flight of Omar-Khan's troops in Mirba Adigezal-bek's “Karabag-name” was described: “The Lezgins, hitting their faces in the mud ... set off to flee. They fled to the borders of the Ganja lands. Since at that time the mountains were covered with snow, it was impossible to make the transition to Dagestan. They thought that after reaching Ganja from there they would go to Karabag and, having stayed there all winter, with the onset of spring would return to their homeland. As soon as the population of Ganja learned about the fate of the Lezgins, drawing their swords, they began to destroy these small and helpless people, even those who survived and fled, caught up and ruthlessly killed. After a long ordeal, they reached Jar and stayed there to spend the winter. After a while, Umma Khan (Omar Khan) fell ill there and died. ” After that, as Adigezal-bek notes, “the faith of the population of Gurdzhistan in the valor and bravery of the Russian victorious troops has greatly increased”.
According to estimates, Omar Khan lost more than two and a half thousand dead, the onset of darkness saved him from further persecution by General Lazarev. The prize for the winners was the camp of Omar Khan and the Avar banner seized on the Iori River. This banner was solemnly delivered to the capital of Russia. The army of Omar Khan collapsed, the campaign against Georgia was the last and deprived him of power and authority.
Emperor Paul I for the victory on Iori granted generals Lazorev, Gulyakov and Kotlyarevsky the highest award of that time - the Order of John of Jerusalem (Maltese Cross), and the lower ranks received a silver ruble. The regiment became known as Shirvan. 18 November 1800, Pavel I signed a manifesto on the accession of Georgia to Russia, and ordered General Knorring to send troops to Eastern Georgia. At the end of December, King George XII died, and his son David became his successor. But he did not last long on the throne. 12 September 1801, the emperor Alexander I promulgated a manifesto on the entry of Georgia into Russia without the right of state autonomy and the Kartli-Kakheti kingdom was transformed into Tiflis province. Knorring was appointed governor-general. General Lazarev was treacherously murdered in 1803 by the Georgian queen Tamara in a palace in Tiflis. General Gulyakov died from a Lezgin bullet, being ambushed in January 1804 in the Zakatala gorge. Headquarters captain Kotlyarevsky became famous during the Russian-Persian 1804-1813 war and received the nickname "Meteor-General".
As a result of the victory of the Russian weapons on the Iori River in the Caucasus, they realized that Georgia was under the protection of the Russian Empire. In the Transcaucasus, a sharp political struggle broke out between the Muslim khans and the Georgian rulers, who had to choose between Russia and Persia. The accession of Georgia also exacerbated Russia's relations with Persia, which claimed these territories, which resulted in the 1804-1813 war. In the course of this war, the Russian Empire annexed the principalities of Western Georgia.