Polish troops under General Józef Adam Lasocki reached the outskirts of the town, which was an important railroad junction, in early March 1919.
In April 1919, Headquarters of the Polish Army had to make a strategic decision: whether to continue fighting the Ukrainians in Eastern Galicia and Volhynia, or to move bulk of the forces to Polesia and Belarus, and face the Soviets.
Soviet forces controlled the towns of Vilnius, Lida, Baranavichy and Luninets, while German units of the Ober Ost remained east of Grodno.
During a bloody street fighting, Poles had to capture one house at a time, but after reinforcements had been brought in, they destroyed railroad track with hand grenades.
The Bolsheviks retreated eastwards, chased by Polish cavalry of the 7th Lublin Uhlan Regiment under Major Janusz Głuchowski.
Polish engineers immediately began working on the destroyed rail track, to enable troop transports to Vilnius.