and the new Meiji government was unable to negotiate a partition of the island into separate territories. In the Treaty of Saint Petersburg (1875), Japan agreed to give up its claims on Sakhalin in exchange for undisputed ownership of the Kuril Islands. Japan invaded Sakhalin in the final stages of the Russo-Japanese War of 1904–1905, but per the 1905 Treaty of Portsmouth was allowed to retain only the southern portion of the island below the 50° N parallel. Russia retained the northern portion, although the Japanese were awarded favorable commercial rights, including fishing and mineral extraction rights in the north. In 1907, Karafuto Prefecture was officially established, with the capital at Ōtomari. In 1908, the capital was relocated to Toyohara. In 1920, Karafuto was officially designated an external territory of Japan, and its administration and development came under the aegis of the Ministry of Colonial Affairs. Following the Nikolaevsk Incident in 1920, Japan briefly seized the northern half of Sakhalin, and occupied it until the establishment of formal diplomatic relations with the Soviet Union in 1925; however, Japan continued to maintain petroleum and coal concessions in northern Sakhalin until 1944. In 1943, the status of Karafuto was upgraded to that of an "inner land", making it an integral part of the Empire of Japan. As Japan was extending its influence over East Asia and the Pacific through the establishment of a Greater East Asia Co-Prosperity Sphere, the Imperial Japanese Army as part of its offensive contingency plans to invade the Soviet Union if it either became involved in the Pacific War or collapsed due to the ongoing German invasion, proposed the annexation of the remaining northern half of Sakhalin to Japan. Soviet invasion In August 1945, after repudiating the Soviet–Japanese Neutrality Pact in April, and according to the signed agreements of Yalta, in which Stalin pledged that the Soviet Union would enter the Pacific War three months after the defeat of Germany, the Soviet Union invaded Karafuto. The Soviet attack started on 11 August 1945, three weeks before the surrender of Japan. The Soviet 56th Rifle Corps, part of the 16th Army, consisting of the 79th Rifle Division, the 2nd Rifle Brigade, the 5th Rifle Brigade and the 214 Armored Brigade, attacked the Japanese 88th Infantry Division. Although the Soviet Red Army outnumbered the Japanese by three to one, they advanced only slowly due to strong Japanese resistance. It was