Following the April 1941 Invasion of Yugoslavia he became a high-ranking member of the Liberation Front of the Slovene Nation (OF), and from 1942 he was interred in Italy. After the capitulation of Italy in 1943, he was released and became a member of the regional branches of OF and the Slovene National Liberation Committee (SNOS) in the Slovenian Littoral region. From 1944 to 1945 he was justice minister in the Yugoslav government-in-exile of Ivan Šubašić, and later served in the unified government of the Democratic Federal Yugoslavia led by Josip Broz Tito until January 1948.