After 40-plus-hours of talks, North and South Korea on Tuesday pulled back from the brink with an accord that allows both sides to save face and avert the bloodshed they've been threatening each other with for weeks.

In an artfully crafted, though vague, piece of diplomacy, Pyongyang expressed "regret" over the fact that two South Korean soldiers were maimed in a recent land mine blast. While not an acknowledgement of responsibility, it allows Seoul to say it has received the apology it has demanded.

South Korea, for its part, agreed to halt anti-Pyongyang propaganda broadcasts, which will let the authoritarian North trumpet to its people a propaganda victory over its bitter rival — and put an end to hated loudspeaker messages that outside analysts say could demoralize front-line troops and inspire them to defect.

The agreement is an important 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.

But it's unclear how long the good mood will continue. The accord does little to address the many major, long-standing differences the rivals still have. The two sides' announcement that they'll hold further talks soon in either Seoul or Pyongyang could do that, but the Koreas have a history of failing to follow through on accords and allowing simmering animosity to interrupt diplomacy.

More On This...

The talks that began 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 — the border is the world's most heavily armed and there has never been a formal peace agreement ending the Korean War, so the area is always essentially in a "quasi-state of war" — 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 Korea 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 Tuesday 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. There were no details on whether the North addressed the artillery claim in Tuesday's deal.

These were the highest-level talks between the two Koreas in a year. So it was something of a victory that senior officials from countries that have spent recent days vowing to destroy each other were even sitting together.

While the Koreas have difficulty agreeing to talks, once they do, lengthy sessions are often the rule. After decades of animosity and bloodshed, finding common ground is a challenge. During the latest Panmunjom talks, the first session lasted about 10 hours and the second session about 33 hours.

The initial decision to start negotiations came 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 defense officials said during the talks that about 70 percent 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.

It was not immediately clear whether North Korea pulled back its submarines and troops after the agreement was announced.