Arrested by the NKVD in January 1941, he was imprisoned and tortured in various Soviet prisons. Released after the Sikorski-Mayski Agreement of 1941, he joined the Polish Army re-created in the USSR, where he assumed the post of the chief of staff. After a brief period as the commanding officer of the Polish 7th Infantry Division he was moved to London for training in the Cichociemni training camp and then transported to occupied Poland. In July 1944, during Operation Tempest, he became the commander of the 2nd Echelon of the Home Army. General Bór-Komorowski, predicting his arrest by the Soviets after the Warsaw Uprising named him his deputy and successor. Okulicki fought in the Uprising, among other posts as the chief of staff of the Home Army. After the capitulation of the Uprising, he managed to evade being captured by the Germans and moved to Kraków, from where he started to reorganize the Home Army. On 3 October 1944 he became the commander of the entire organization. On 19 January 1945, after the Soviet takeover of Poland, he ordered the disbandment of the Home Army, fearing that future existence of an Allied force in Poland would only lead to more people being murdered or arrested by the Soviets. Following an NKVD provocation, he was arrested and imprisoned in Moscow.