The siege of Asfara (May-June 1495) was an early success for Babur, then the recently installed king of Fergana, and saw him defeat a rebellion raised in the name of Sultan Baisanghar Mirza of Samarkand.
Both Babur and Baisanghar had recently come to their thrones after the deaths of their fathers, Babur in 1949 and Baisanghar early in 1495. Baisanghar's father Sultan Mahmud only ruled for a short time after succeeding his brother Ahmad Mirza, who died just after abandoning an attack on Babur's kingdom. Baisanghar inherited his uncle's ambitions in Fergana.
Baisanghar's approach appears to have been to encourage rebellion in Fergana. In the spring of 1495 Ibrahim Saru, a Mongol who had served Babur's father before falling from favour, captured the fort of Asfara (or Asfera), near the southern border of Fergana. He then declared for Baisanghar by having his name read out during the weekly prayers.
Ibrahim made his move at a very bad moment. Just as he was raising the banner of revolt, Baisanghar was attacked by Sultan Mahmud of Tashkent. Although Mahmud was defeated in battle at Kan-bai, this meant that Baisanghar was unable to help Ibrahim, and allowed the young Babur to focus all of his attentions on the upcoming siege.
Babur's army left his capital of Andijan in May 1495 and by the end of the month had reached Asfara. When they arrived Ibrahim was in the process of building a new outer wall around the fort, which in a fit of over-enthusiasm Babur's men attacked on the day they arrived at Asfara. This assault successfully captured the outer wall, but not without a heavy cost - Babur's own guardian was killed by a crossbow bolt during the fighting, as were a number of un-armoured warriors.
After this initial assault Babur settled down to conduct a regular siege, building ramps at two or three places around the walls (described as sar-hob or head-strikes, these were designed to give the besiegers vantage points from where they could fire on any defenders who appeared on top of the walls of the fort). Mines were also run under the walls.
The siege lasted for forty days, by which time it was clear that Ibrahim could expect no help, surrendered and was taken back into Babur's service. The initiative soon passed to Babur, who would be involved in sieges of Samarkand in 1496 and 1497, and would briefly occupy the city after the second siege.