North and South Korea have pulled back from the brink with an accord that allows both sides to save face.
In a carefully crafted piece of diplomacy following more than 40 hours of talks, Pyongyang expressed "regret" that two South Korean soldiers were maimed in a recent land mine blast Seoul blamed on the North.
While not an acknowledgement of responsibility, let alone the "definite apology" South Korea's president had demanded, it allows Seoul to claim some measure of victory in holding the North to account.
South Korea, for its part, agreed to halt anti-Pyongyang propaganda broadcasts on the border, which will let the authoritarian North trumpet to its people a propaganda win over its bitter rival.
The agreement marks a good first step in easing animosity that has built since South Korea blamed North Korea for the mine explosion at the border earlier this month and restarted the propaganda broadcasts in retaliation.
Despite South Korean President Park Geun-hye's expression of hope that the North's "regret" will help improve the Koreas' relationship, the accord does little to address the many fundamental, long-standing differences.
The announcement of further talks to be held soon in either Seoul or Pyongyang could be a beginning, but the Koreas have a history of failing to follow through on their promises and allowing simmering animosity to interrupt diplomacy.
The negotiations that began on Saturday at the border village of Panmunjom, where the Koreas agreed to the 1953 ceasefire that stopped fighting in the Korean War, also resulted in Pyongyang agreeing to lift a "quasi-state of war" declared last week, according to South Korea's presidential office and North Korea's state media.
While this declaration was largely a matter of rhetoric there had been growing worry about South Korean reports that the North continued to prepare for a fight during the talks, moving unusual numbers of troops and submarines to the border.
The Koreas also struck an important humanitarian agreement by promising to resume in September the emotional reunions of families separated by the Korean War. They said more reunions would follow, but there were no immediate details.
In a signal of North Korea's seriousness, Pyongyang sent to the talks Hwang Pyong So, the top political officer for the Korean People's Army and considered by outside analysts to be North Korea's second most important official after supreme leader Kim Jong Un.
"I hope the two sides faithfully implement the agreements and build up (mutual) confidence through a dialogue and cooperation and that it serves as a chance to work out new South-North relations," chief South Korean negotiator and presidential national security director Kim Kwan-jin said in a televised news conference.
The United States quickly welcomed the agreement and the prospect of tensions dropping.
Kim, the Seoul negotiator, described the North's expression of "regret" as an apology and said the loudspeaker campaign would end at noon today unless an "abnormal" event occurs.
Pyongyang had denied involvement in the land mine explosions and rejected Seoul's report that Pyongyang launched an artillery barrage last week. South Korea's military fired dozens of artillery rounds across the border in response and said the North's artillery strikes were meant to back up an earlier threat to attack the loudspeakers
These were the highest-level talks between the two Koreas in a year, and the length of the sessions was no surprise.
The negotiations started just hours ahead of a Saturday deadline set by North Korea for the South to dismantle the propaganda loudspeakers. North Korea had declared that its front-line troops were in full war readiness and prepared to go to battle if Seoul did not back down.
South Korean defence officials said during the talks that about 70% of the North's more than 70 submarines and undersea vehicles had left their bases and could not be located by the South Korean military. They also said the North had doubled the strength of its front-line artillery forces since the start of the talks.
Kim Min-seok, a spokesman for Seoul's Defence Ministry, said that the South Korean military was seeing signs that some of the North's submarines and undersea vehicles were returning to their ports.