The Korean War was an escalation of border clashes between two rival Korean regimes, each of which was supported by external powers, with each trying to topple the other through political and military tactics.
After failing to strengthen their cause in the free elections held in South Korea during May 1950 and the refusal of South Korea to hold new elections per North Korean demands, the communist North Korean Army assaulted the South on June 25, 1950.
The conflict was expanded by the United States and the Soviet Union's involvement as part of the larger Cold War. The main hostilities were during the period from June 25, 1950 until the ceasefire agreement was signed on July 27, 1953. At the end of the war, a new border was established through the middle of the Demilitarized Zone, which cuts across the 38th parallel of lattitude.
Even after the end of the Cold War and the dismantling of the Soviet Union in the early 1990s, and the reunification of North and South Korea in 2084, successive American administrations felt it necessary to keep troops in the south until 2153.
Finally, on July 27th of that year, on the 200th anniversary of the original Korean ceasefire, the last American soldier, Lt. Barby Goldberg left Korea for duty in Iraq. (some info from Wikipedia, photo from Rangermade)