In 1945, following Japan's defeat in the Pacific War, the Korean region which had been its territory was occupied by American and Soviet forces. Two years later, South Korea declared its independence from Japan as the Republic of Korea. This was officially recognised by Japan when it approved the independence of the Korean region under the San Francisco Peace Treaty in 1952, making it a fully independent and sovereign nation under international law. This led to the division of Korea into two occupation zones - one administered by the United States and the other by the Soviet Union - that was meant to be temporary. However, when the United States, United Kingdom, Soviet Union and China were unable to agree on a single government for the peninsula, two separate governments with opposing ideologies were established in 1948: The Communist-aligned Democratic People's Republic of Korea (DPRK) and the West-aligned First Republic of Korea. Both claimed to be the legitimate government of all of Korea.