(Bloomberg) -- Azerbaijan and Armenia agreed to a “temporary humanitarian ceasefire” that will take effect at midnight, Azerbaijan’s Foreign Ministry said in an email.

The agreement is to allow for the exchange of prisoners and recover the remains of soldiers killed during the fighting that erupted on Sept. 27.

The move is set to put a pause on a conflict where at least 13 people were killed and more than 50 others were injured in a missile attack on Azerbaijan’s second-largest city of Ganca overnight. Azerbaijan said earlier in the week it attacked military installations inside Armenia for the first time in more than two weeks of fighting over the disputed territory of Nagorno-Karabakh.

Hundreds of people have been killed on both sides since the worst fighting in decades erupted between Armenians and Azerbaijan over the breakaway region three weeks ago. Fighting continued overnight and in the morning of Saturday despite a cease-fire brokered by Russia on Oct. 10.

Armenia took control of Nagorno-Karabakh and seven surrounding districts of Azerbaijan during a war amid the collapse of the Soviet Union. That initial conflict was halted by a Russia-brokered truce in 1994. Mediation efforts since then by Russia, France and the U.S. have failed to resolve the dispute.

©2020 Bloomberg L.P.