During the Russo-Japanese War, Japan was able to invade and occupy the whole of Sakhalin island over several weeks in July 1905. By the Treaty of Portsmouth, which concluded the war, Russia ceded the southern half of Sakhalin to Japan (incorporated as Karafuto Prefecture), while Japanese troops withdrew from its northern half; thus the two countries the first time in their history shared a land border, which ran along the 50th parallel north across the entire island of Sakhalin, from the Strait of Tartary to the Sea of Okhotsk. Even though Japan occupied the northern part of Sakhalin in 1920–1925, during and after the Russian Civil War, Soviet control in the northern Sakhalin was established in 1925, and the 50th parallel became the Japan-USSR border.