After Germany invaded the Soviet Union on 22 June 1941 Panfilov began mobilizing reserves to be sent to the front. On 12 July he was assigned as the commander of the 316th Rifle Division, a new unit being formed in Alma Ata. The division consisted mainly of reservists from the Kazakh and Kyrgyz Soviet Republics.