The siege of Andijan of 1499 was an unsuccessful attack on Babur's recently regained capital made by his chief rival Tambal in the aftermath of a revolt amongst Babur's Mongol mercenaries.
Babur had lost control of his kingdom of Fergana in 1498, in the aftermath of his successful siege of Samarkand. After a year spent in exile he regained his kingdom in the spring and early summer of 1499, returning to Andijan in June. His two main opponents fled the capital. Auzun Hasan fled west, and was quickly captured, but Sultan Ahmad Tambal retreated east to Auzkint, where he remained safe for the moment.
Babur had regained his throne with the help of a large number of Mongol mercenaries, while another group had come into his service after abandoning Auzun Hasan. This second group had been fighting against him until recently, and Babur now ordered them to return any goods that they had taken from his supporters during the fighting. Unsurprisingly the Mongols didn't accept this, and instead large numbers of them deserted Babur and offered their services to Tambal. He advanced west towards Andijan, overcoming an army led by one of Babur's generals at the Ailaish River, a day east of the city.
In the aftermath of this victory Tambal, with Babur's brother Jahangir, advanced towards Andijan, and took up a position at the Hill of Pleasure, two miles east of the city. For the next month he threatened the city, although apparently without conducting a regular siege. On three occasions he advanced towards the city, but was unable to fight his way through the suburbs.
After about a month Tambal abandoned his attempt to capture Andijan, and moved south-east to attack Aush. This place was too strongly held, and so Tambal moved north, briefly raiding towards Andijan, while leaving a garrison at Madu (modern Mady, on the road from Osh to Kashgar). This soon fell to Babur, and for some time the two armies faced each other at Ab-i-khan. This stalemate ended with Tambal made another attempt to advance towards Andijan. This time Babur was able to catch him, and defeated him in his first battle as a commander, at Khuban.