The large Muslim army, under the command of Ilghazi, was unable to maneuver and suffered a devastating defeat due to King David IV's effective military tactics.
After pillaging the County of Edessa and defeat of Roger of Antioch at the battle of Ager Sanguinis in 1119, the reputation of Ilghazi as a great military commander and champion of Muslims against Christians spread far and wide.
In mid-summer 1121, the Muslim troops advanced along various routes, with part of them passing the provinces of Erzerum and Kars, while Sultan Toghrul ibn Muhammad moved through Ganja and Tughan-Arslan the "Hunchback" marched from Dvin.
"[28] According to Matthew of Edessa, the Muslim coalition numbered 560,000 men in total, led by Ilghazi with his vassal Tughan-Arslan, and with support from nomadic Arab tribes.
According to Al-Fāriqī, Ilghazi selected the route from Kars to Javakheti and Trialeti to reach Tbilisi, where he could camp, rest, and then act against the Georgians.
The Muslim army under the overall command of Ilghazi entered the valley of Trialeti in eastern Georgia and encamped in the vicinities of Didgori and Manglisi in 10 August 1121,[29] about a day's march from Tbilisi.
The core component of David's army was the so called mona-spa, or servant host, the personal retinue of the king, which consisted of 5,000 well-trained and heavily armored mounted warriors with lances and bows.
The Crusaders, the Kipchak cavalry, and a small portion of infantry were deployed in the center of the Georgian army around the king's banner while the rest were equally split in two major wings initially out of sight for the Seljuqs.
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!
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.
In turn, the Kipchaks provided one soldier per family, allowing King David to establish a standing army in addition to his royal troops.
"On August 11, 1121, King David led his army along the Nichbisi valley from the ancient capital of Mtskheta and divided his troops into two parts, one under his personal command and the other smaller group under his son Demetrius I, hidden in reserve behind the nearby heights with orders to attack the flank at a given signal.
Ilghazi and his son-in-law both survived the attack on the vanguard, but were severely injured during the fight and withdrew from the battlefield, leaving the Seljuq army virtually leaderless.
When the Georgian infantry joined the fight, the Seljuq troops started to panic and retreated en masse through the huge gap in their army's rearguard, which wasn't engaged in the battle.
According to a Georgian chronicler, King David’s troops pursued them for three days “putting all of them to the sword and leaving them to the carnivorous beasts and birds of the mountains and plains” of the Manglisi Valley.
Aside from those accounts, it has also been suggested that confronted by a vanguard of the large invading force, David had to rely on the advantages the nearby terrain offered to disguise his troop movements.
Ilghazi reportedly received an injury to his head when a hundred crusaders managed to break through his lines, rushing towards the Seljuq command banner.
As a result, the Georgians were able to liberate the entire region from Muslim influence and even contest territories within the Seljuq Empire, which at that point was left almost defenceless.
However, the Arab historian al-'Ayni (1360–1451), who utilizes sources, some of which have not survived, admits that the city was pillaged but says that the Georgian king eventually showed patience and "respected the feelings of the Muslims.
It signaled the emergence of Georgia as a military power in the late 11–12th centuries and shifted the balance scales in favor of Georgian cultural as well as political supremacy in eastern Asia Minor.