Korea had been ruled by Japan until 1945 when it was divided along the 38th parallel after Japan's surrender, with the Soviet Union occupying the north and the US occupying the south. This division led to the establishment of authoritarian regimes in both North and South Korea, led by Kim Il-sung and Syngman Rhee respectively, which sought to reunify Korea under their ideology. Border skirmishes increased and nearly 10,000 troops were killed before the 1950 outbreak of the Korean War, when North Korea launched a surprise attack on the South. The UN authorized a force led by the US to defend South Korea.