After the Battles of Khalkhin Gol ended the Japanese–Soviet Border War in 1939 and before the USSR declared war on Japan (Manchurian Strategic Offensive Operation) on August 8, 1945, there was practically no hostile activity between the USSR and the Empire of Japan. Japan was a main ally of Adolf Hitler and Nazi Germany––which the USSR initially had an understanding with, but found itself at war with from June 22, 1941. Millions of Soviet and Japanese soldiers were facing each other along the border. The Soviet–Japanese Neutrality Pact was signed in Moscow on April 13, 1941 and became effective on April 25, but was renounced by the Soviet Union on 5 April 1945, as in accordance with the Pact itself, it remains relevant for 5 years and automatically renews for the next 5 years if any of the countries does not renounce the Pact a year before the date of its expiry. So, the USSR used its legal right and renounced the Pact.