In 1219, the Mongol Empire attacked the Khwarezmian Empire, and within two years effectively destroyed, driving its ruler to his death and capturing all its territory north of Iran. By summer 1221, Chinggis Khan was in modern Afghanistan, his sons returning from victories across Khwarezm, when he received news of sudden reversals. The son of the late Khwarezm-Shah, Jalal al-Din Mingburnu, had taken up his father's throne and rallied an army of Qangli Turks, Khalaj, Ghuris and Afghans in Ghazna. Within short order he had defeated two Mongol armies, one under Chinggis Khan's adopted son, the Tatar Shigi Qutuqu at Parwan. News of Mongol defeats led to revolt across a number of conquered cities, and Chinggis, now with a reinforced army, rode south to catch Jalal al-Din.
But victory defeated Jalal al-Din. In the aftermath of Parwan, his two most important commanders fought each other over loot, and in the night the commander of the Khalaj, Aghraq-Malik, abandoned the coalition in the night alongside a number of other leaders. By the morning, Jalal al-Din's army had been halved, perhaps 20-30,000 strong. Aware that the Mongol would be mobilizing to chase him down as they had his father, Jalal al-Din abandoned Ghazna and made to retreat to the Delhi Sultanate in India.
Chinggis moved rapidly, taking Bamiyan en route, at the siege of which, his favourite grandson and Chagatai's son Moetugen was killed. Bamiyan was destroyed. By autumn (November according to Nasawi, but Juvaini provides a more detailed lead up and indicates it was earlier) Chinggis Khan, with a large force reinforced with three of his sons (Chagatai, Ogedai and Tolui) caught Jalal al-Din while he readying boats to cross the Indus River into India. The battle was fierce, but Jalal al-Din's wings fell away under the Mongol assault. The centre, commanded by Jalal al-Din himself, held out, leading charges to drive back the Mongols, but still they pressed on.
Soon, Jalal al-Din knew it was lost. With one final charge, his men gained their Sultan some space from Mongol riders, and then Mingburnu spurred his horse off the cliffs, and into the river. Mongol archers made it to edge to pick off Jalal al-Din, but Chinggis Khan himself held them back as Jalal al-Din made it to the far river bank, sword still in hand and leading his horse. Chinggis commended the man's courage, saying how every father dreamed of such a son (in earshot of his own children). The other Khwarezmians who tried to make the swim were not so lucky, and sank, pierced with arrows.
Chinggis would send Chagatai, and later the general Dorbei Doqshin, to hunt down Jalal al-Din, but he escaped and remained in India until 1225. In time he returned, making his way to Tabriz and spending years fighting the Georgians, Seljuqs of Rum and Ayyubids, until Kurdish highwaymen killed him around 1231.
The battle of the Indus was effectively the end of the Khwarezmian campaign. Some cities and fortresses still held out, and the Khwarezmian territory in Iran was left largely untouched for the 1220, with Transoxania and Khurasan incorporated into the empire. Chinggis made his way back, reaching Mongolia around 1225, and the next began his final campaign against the Tangut Xi Xix Kingdom, where he died in August 1227.
For more on the Mongol invasion of the Khwarezmian Empire, check out my video on the topic: https://www.youtube.com/watch?v=oBazW15L-F0