(CNN)"KOREAN WAR TO END!" US President Donald Trump tweeted that ebullient statement after an historic meeting between his South Korean counterpart Moon Jae-in and North Korean leader Kim Jong Un at the demilitarized zone (DMZ) in April.
Could Trump and Kim agree to a peace treaty ending the Korean War?
Under the Panmunjom Declaration signed by Moon and Kim, the Koreas pledged to work towards a formal end to the Korean War, 65 years after hostilities ceased.
The two leaders, who greeted each other with handshakes and embraces, might have preferred to sign a peace treaty then and there, but like most things on the Korean Peninsula, it's more complicated than that. Both China and the US (under the banner of the United Nations) were major combatants in the Korean War, and their involvement will be required for any official end to the conflict.
Beijing has indicated its support for a formal peace agreement, and Trump's meeting with Kim this week could provide the ideal moment to begin negotiations to replace the 1953 armistice with a new treaty.
Any such treaty would have to clear a number of hurdles, but just months ago, the mere suggestion of a meeting between the US President and North Korean leader would have seemed absurd.
Rodger Baker, senior VP of strategic analysis at Stratfor, said a peace deal would usually be a "phased process, tied in with disarmament and removal of sanctions."
"There have been suggestions, however, that should things go well the Chinese and South Koreans are ready for quick action on replacing the Armistice Agreement," he said, adding that given Kim and Trump's unpredictability "we shouldn't be too surprised if there is faster progress than would normally be expected."
The Japan-colonized Korean Peninsula was divided in two following Tokyo's surrender at the end of World War II, with the Soviet Union occupying the North and the US the South.
Two new ideologically opposite countries were established in 1948: The Republic of Korea (South Korea) and the Democratic People's Republic of Korea (North Korea).
Strongman leaders in both sought full reunification of the peninsula under their rule, and in June 1950 forces under North Korean leader Kim Il Sung crossed the 38th parallel into the South.
United Nations forces, led by the US, intervened on behalf of South Korea's authoritarian leader Syngman Rhee, while China supported Kim and eventually largely replaced his forces in the field.
More than 1.2 million soldiers were killed on all sides, and an additional 1.6 million civilians, many killed by a brutal US bombing campaign which left most of North Korea in ruins.
Hostilities finally ceased on July 27, 1953, when an armistice was signed by Chinese, North Korean and UN forces, establishing the DMZ which separates the two Koreas to this day.
The 1953 agreement calls for all sides to hold a political conference "to settle through negotiation the questions of the withdrawal of all foreign forces from Korea (and) the peaceful settlement of the Korean question."
That summit, the Geneva Conference of 1954, ended in spectacular failure. Not only did it not produce a peace treaty ending the Korean War, but negotiations over France's withdrawal from its colonies in Indochina set the stage for the Vietnam War.
Part of the problem in Geneva was the lack of support from Rhee's government in South Korea for peace. He had not signed the armistice, and in Switzerland advanced proposals for UN supervised elections were to be held in the North to replace Kim's government (but not his own).
North Korea suggested elections be held for the entire peninsula, and all foreign forces (including UN forces) leave beforehand. China suggested that the vote be overseen by a group of neutral nations.
Rhee's unwillingness to back down on demands Chinese forces leave the Peninsula before any vote could take place frustrated his US allies, but ultimately Washington supported him, and refused to accept proposals from Beijing and Pyongyang the allies said would "maintain Communist control over North Korea."
One of the biggest hurdles for any proposed peace treaty to clear immediately after the war was that governments of both North and South Korea wanted control over the entire peninsula.
As the division of the two countries has continued however, a peace treaty based on the current status quo has become more likely.
Under the Panmunjom Declaration signed by Moon and Kim, the Koreas agreed to pursue a "permanent and solid peace regime" which includes the preclusion of the "use of force in any form against each other" and vows to "transform the demilitarized zone into a peace zone."
While it acknowledged that unification was an "enduring aspiration" of both Koreas, the agreement does not make this a precondition for peace. Nor is the denuclearization of the peninsula to be carried out before peace is agreed.
Pyongyang's apparent willingness to accept US forces' presence on the Korean Peninsula also improves the possibility of an agreement stemming from the Trump and Kim talks. Any attempt to persuade the US to abandon its military bases in South is likely to be a non-starter while North Korea still has nuclear weapons.
Denuclearization -- which means different things to both parties -- could therefore be a goal of a potential peace treaty, rather than a precondition for it.
"Pursuing a peace accord without addressing the nuclear and missile program, past terrorist activities or human rights has been politically taboo," Stratfor's Baker said, though he added there was no technical reason this could not happen.
This could result in a peace treaty that looks a lot like the current armistice, recognizing the DMZ as the border between North and South (but perhaps leaving the door open to future unification) and formally ending hostilities between all four parties which fought the original war.
That would make it more difficult and costly for North or South to take hostile actions against each other: they would not be threatening enemy combatants but nations with which they are at peace, potentially in breach of international law.
Eventually, such an arrangement could see the gradual demilitarization of one of the most fortified regions of the world, after almost seven decades of war.
While desire for a formal peace is strong in South Korea, and Moon has signaled his willingness to pursue a treaty without too many preconditions, Seoul has perhaps the least influence over this process.
Both North Korea and the US could make demands that derail talks between Trump and Kim, or any future negotiations, just as has happened many times in the past.
China too could affect the process, either by influencing North Korea or by withholding its own assent to an eventual peace treaty. Beijing has spoken of the need for formal peace, but like Pyongyang it is no fan of the massive US military presence on the peninsula.
While Moon may be supportive of the process, and has record high approval in South Korea, there's no guarantee his successor will feel the same way. South Korean Presidents are limited to a single five-year term in office, and previous rapprochement with North Korea under liberal governments has been derailed by future conservative administrations.