Early in 1262, Berke Khan dispatched Nogai with 30,000 men as his vanguard, while he followed with the main army. Advancing past Derbent, they encamped outside Shirvan. Hulagu Khan sent word to his dispersed forces across Iran to proceed and set out with his main force in August. In mid-October, Berke's troops defeated Hulagu's vanguard, commanded by Shirämün Noyan, near Shamakhi. On November 15, The Ilkhanate general Abatai Noyan arrived, attacked, and defeated Berke's army around Shabaran, killing many of them. Nogai fled. Pressing the advance, Hulagu and his men continued to pursue Berke and Nogai and, on the early morning of Friday, December 7, arrived at Derbent, where some of the enemy troops appeared on the walls but were driven away by arrows, the place was then stormed and taken. On the other side, a battle took place which ended in a heavy defeat for Berke, who, with his army unable to withstand the onslaught, took flight. They were pursued and the slaughter continued until the end of Saturday. A week later, on December 15, Nogai, perhaps attempting to slow down Hulagu, yet again suffered a crushing defeat and continued to flee. The victorious Ilkhanate forces continued their pursuit and crossed the Terek River, capturing their tents. When Berke and his soldiers learned of this, they turned back and attacked the disorganized Ilkhanate army. On January 13, 1263, a fierce battle raged on the banks of the Terek River from dawn until nightfall. As Berke’s reinforcements kept pouring in, the Ilkhanate army turned in flight. While crossing the frozen river, the ice cracked under their weight, and many soldiers drowned. Berke and his army then withdrew to Derbent. Hulegu was loyal to his brother Kublai, but clashes with their cousin Berke, the ruler of the Golden Horde in the northwestern part of the Empire, began in 1262. The suspicious deaths of
Jochid princes in Hulegu's service, unequal distribution of war booties and Hulegu's massacres of the Muslims increased the anger of Berke, who considered supporting a rebellion of the
Georgian Kingdom against Hulegu's rule in 1259–1260. Berke also forged an alliance with the Egyptian Mamluks against Hulegu, and supported Kublai's rival claimant, Ariq Böke. Kublai dispatched an army under
Abaqa to attack the Golden Horde, while Ariq Böke sent
Nogai to invade the Ilkhanate; both sides suffered disastrous defeats. Hulegu marched northwards through the Pass of Derbent against Berke. On the banks of the
Terek, he was ambushed by an army of the Golden Horde under Nogai, and his army was defeated at the Battle of the Terek River in 1262, with many thousands being cut down or drowning when the ice of the river gave way. Hulegu subsequently retreated back into
Azerbaijan. Ariq Böke surrendered to Kublai at
Shangdu on August 21, 1264. The rulers of the Golden Horde and
Chagatai Khanate subsequently acknowledged the reality of Kublai's victory and rule, after which Kublai began preparations for his conquest of the
Song dynasty. When the
Byzantine Empire, the ally of the Ilkhanate, captured Egyptian envoys, Berke sent an army through his vassal
Bulgaria, prompting the release of the envoys and the
Seljuq Sultan Kaykaus II. He tried to raise
civil unrest in
Anatolia using Kaykaus but failed. In the new official version of the family history, Kublai Khan refused to write Berke's name as the
khan of Golden Horde for his support to Ariq Böke and wars with Hulegu. However, Jochi's descendants were fully recognized as legitimate family members. Kublai Khan also reinforced Hulegu with 30,000 young Mongols in order to stabilize the political situation in the western khanates. As soon as Hulegu died on February 8, 1265, Berke marched to cross the Terek near
Tiflis, but died on the way. Within a few months of these deaths,
Alghu Khan of the Chagatai Khanate died, too. This sudden vacuum of power somewhat relieved Kublai's control over the western khanates. ==Aftermath==