Occupied by the Soviet Union following the Molotov-Ribbentrop Pact of 1939, it was subject to harsh policies of the NKVD. The uncompleted prison was taken over by the NKVD in December 1939 and was used for political prisoners from all parts of Soviet-occupied Poland. Between 1500 and 3000 prisoners were kept there in harsh conditions, with new inmates arriving after the previous ones were successively transported to Gulag and other Soviet prisons. In 1940 most of the local Poles were arrested and resettled to various Soviet Gulags and prisons throughout the USSR. In 1941, following the outbreak of Soviet-German War, on June 24 and June 25, 1941, approximately 550 prisoners of the Dubno prison were executed by the withdrawing NKVD while only 8 of them survived. About that time in the vicinity of the town (and around Lutsk and Brody) a large tank battle was fought. In the Battle of Brody (1941) the German 1st Panzer Group under Ewald von Kleist managed to break the counter-attack by Soviet 9th and 19th Mechanized Corps, and 8th Mechanized Corps. 8th Corps Tank Group took Dubno and held it for 5 days before it was retaken by stronger German forces' (under Konstantin Rokossovski, Nikolay Feklenko and D.I Rybjasev, Commander of 8th Corps Tank group was brigade commisar N.K. Popel, respectively). Soon afterwards the town was occupied by Germany. During the occupation, the Germans blew up the historic town hall from the 18th century.