By August 21, the army's remnants were hurriedly retreating eastwards in small groups, mostly avoiding roads and towns, with the 27th Division, down to 25% strength, guarding the rear and covering the retreat of both the 16th Army and the Mozyr Group. On August 22, Białystok was captured by the Polish 1st Legions Infantry Division, cutting off stragglers from the army and the Mozyr Group. The 27th Division launched a counterattack and briefly opened the road, but Putna left the area after a Polish counterattack retook the gains, leaving the stragglers to capture. Three days later, the division crossed the Niemen, moving towards Vawkavysk, away from the Polish forces. After withdrawing east of the Niemen back into Belarus, Tukhachevsky began preparations for renewing the offensive. As part of the resulting reorganization of the Red Army units of the front, the two best units of the 16th Army, the 2nd and 27th Divisions, were transferred to the 15th Army. In exchange, the army received the 48th and 56th Rifle Divisions, bringing it back up to its strength before the Battle of Warsaw, and its headquarters was located at Slonim.