Minsk was occupied by the invading Germans on 26 June 1941. Kozlov remained behind the enemy's lines and was appointed chief of the Voblast's underground Communist Party in July. He was tasked with organizing resistance activities, and led the Minsk partisans until the end of the German occupation. By mid-1942, he commanded a force that consisted of some 50,000 members. In September, he traveled to Moscow to report on the situation in Belarus. There, he was awarded the title Hero of the Soviet Union on 1 September 1942. As commander of one of the occupied republic's largest partisan detachments, he was given the rank of a Major General on 16 September 1943. In July 1944, the Red Army liberated Minsk. Kozlov remained the chairman of the Minsk Voblast's Communist Party regional committee, an office he held for four further years.