The defense ministers of Thailand and Cambodia said Saturday that they had agreed to a 72-hour ceasefire, possibly paving the way for an end to a brutal 20-day border war that killed dozens of people and displaced hundreds of thousands more.

The surprise announcement followed two days of tense negotiations between the two countries’ militaries and came amid growing pressure from the United States and China to halt the fighting. The ceasefire was scheduled to begin at noon Saturday, according to Cambodian state television.

As part of the deal, Thailand said it would release 18 Cambodian soldiers who were detained in July during an earlier round of armed conflict between the two countries, once the 72-hour ceasefire period had passed. Both nations also said they would commit to clearing land mines along their shared border, which have figured prominently in the recent clashes.

At a news conference after the ceasefire was announced, Nattaphon Narkphanit, the Thai defense minister, described the 72-hour truce as a testing period to evaluate whether a more enduring peace could begin. “The ceasefire will be monitored and observed for 72 hours to confirm that it is real and continuous,” he said. “Once the situation stabilizes, civilians will be able to safely return to their homes.”

Later Saturday, U.S. Secretary of State Marco Rubio issued a statement welcoming the announcement of the ceasefire and referred back to an earlier agreement that President Donald Trump oversaw in October. “We urge Cambodia and Thailand to immediately honor this commitment and fully implement the terms of the Kuala Lumpur Peace Accords.”

In effect, the ceasefire returns both sides to the terms of that deal. There is no guarantee that the accord will hold, however, chiefly because it does not resolve the core issue between Thailand and Cambodia: that large stretches of their nearly 500-mile-long border remain undefined.