The 5th Ural Infantry Division was organised during the Russian Civil War on September 3, 1918, out of several smaller partisan detachments in Birsky Uyezd of Perm Governorate. Soon it was reinforced with a single artillery battery from Sankt Petersburg and two Workers' Brigades from the Arkhangelsk Front. The division fought in the Eastern Front of the Russian Civil War against the White Army led by Alexander Kolchak. It was part of the 3rd Army and fought in battles around Osa during the defence of Perm from November 29 to January 6, 1919. Transferred to the 2nd Army in January, it defended the Kama area in battles on the Kungur direction in the Osa area from January to March. During the Spring Offensive of the Russian Army between March and May, the division retreated to the line of the Kama River and the Vyatka River. On March 19 it was renamed the 21st Rifle Division. When the Red counteroffensive began in May, the division fought in the Sarapul–Votkinsk Operation between May 25 and June 12, advancing towards Izhevsk and Votkinsk and reaching the mouth of the Vala River. It then fought in the Perm Offensive between June 21 and July 1, crossing the Kama, Osa, and Iren Rivers and capturing the cities of Osa, Okhansk, and Kungur.