At the start of the Russo-Lithuanian war of 1500–1503, Lithuanians suffered a major defeat in the Battle of Vedrosha. Great Hetman (army commander) Konstanty Ostrogski was captured and was replaced by Semyon Olshanski who had gained military experience during the Polish–Ottoman War (1485–1503). But Olshanski was quickly replaced by Kęsgaila who had no prior military experience. Such appointment is difficult to explain, but possibly it was a result of diplomatic negotiations that ended in a military alliance with the Livonian Order. Kęsgaila brought Lithuanian army to help the besieged Mstislavl and Smolensk, but in both cases the Russians retreated without a fight. He was replaced as Great Hetman by Stanisław Kiszka who distinguished himself in organizing Smolensk's defense.