Japan's armed forces initially achieved large-scale military successes during the Second Sino-Japanese War (1937–1945) and the Pacific War. However, starting from 1942, particularly after the Battles of Midway and Guadalcanal, Japan was forced to adopt a defensive stance, and the American island hopping campaign meant that Japan was slowly losing all of the territory it had gained, and eventually, the Americans captured Iwo Jima and Okinawa Island, leaving the Japanese mainland completely unprotected. The U.S. forces had planned an invasion, but Japan surrendered following the atomic bombings of Hiroshima and Nagasaki and the nearly simultaneous Soviet declaration of war on August 9, 1945, and subsequent invasion of Manchuria and other territories. The Pacific War officially came to a close on September 2, 1945. A period of occupation by the Allies followed. In 1947, with American involvement, a new constitution was enacted, officially bringing the Empire of Japan to an end, and Japan's Imperial Army was replaced with the Japan Self-Defense Forces. Occupation and reconstruction continued until 1952, eventually forming the current constitutional monarchy known as Japan.