The agreement puts a pause to a 15-month war that has devastated the enclave, and left tens of thousands dead.