GORIS, Armenia — Armenia and Azerbaijan agreed to a new cease-fire in their conflict over a disputed territory, the countries said Saturday, days after a truce negotiated a week earlier had unraveled.

The warring neighbors in the southern Caucasus region announced the agreement over the disputed territory, Nagorno-Karabakh, in terse statements issued by their foreign ministries late Saturday, describing it as a “humanitarian truce” to allow prisoners and the remains of the dead to be exchanged.

But the intense fighting leading up the announcement raised questions of whether this cease-fire would be any more durable than the deal reached after 10 hours of talks in Moscow last weekend, which failed to end the fierce conflict along the front line.

The new truce took effect at midnight, but neither side provided a timeline for how long it would last.

France said it mediated the latest cease-fire in the days and hours leading up to Saturday’s announcement, in coordination with Russia and the United States.

“This cease-fire must be unconditional and strictly observed by both parties,” the office of President Emmanuel Macron of France said in a statement. “France will be very attentive to this and will remain committed so that hostilities cease on a lasting basis and that credible discussions can quickly begin.”

Any halt in the conflict would be welcome for people in and around Nagorno-Karabakh, in the volatile southern Caucasus region between the Caspian Sea and the Black Sea.

The war has already killed more than 600 Armenian soldiers, scores of civilians and an unknown number of Azerbaijanis. It has threatened to spiral into a wider regional conflict, with the potential to further draw in Turkey, Azerbaijan’s main ally; Russia, which has a mutual defense agreement with Armenia; and even the region’s southern neighbor, Iran.

Nagorno-Karabakh is an ethnically Armenian enclave that is part of Azerbaijan under international law but is closely aligned with Armenia.

A previous war over Nagorno-Karabakh, in the early 1990s, killed some 20,000 people and displaced about a million, most of them Azerbaijanis. Years of tensions since then between Armenia and Azerbaijan over the enclave’s status erupted into open warfare on Sept. 27, with Azerbaijan seeking to take control of the territory by force.

On Saturday, Azerbaijan said 14 people were killed in the city of Ganja, the country’s second-largest, in an overnight missile attack by Armenia.

The capital of Nagorno-Karabakh, Stepanakert, had also been attacked overnight Friday, the din of air raid sirens and explosions echoing through the largely empty city into early Saturday morning.

Along the front, Azerbaijan and Armenia have engaged in trench warfare and artillery combat, taking heavy casualties while fighting for small bits of territory.