Mozambique's government and the former rebel Renamo movement have signed an accord to end two years of low-level fighting.
The unrest had raised fears the southern African country would slip back into civil war, two decades after Renamo and the ruling Frelimo party ended hostilities.
The signing follows passage of a law granting amnesty to Renamo fighters, including the group's leader Afonso Dhlakama, who returned to the bush in 2012 after accusing Frelimo of monopolizing political and economic power in the country.
Dhlakama was not present for the signing ceremony late Sunday in the capital, Maputo. Renamo's negotiator Saimone Macuiane signed the accord along with government representative Jose Pacheco.
Macuiane called the agreement an important step toward peace.
The agreement calls for Renamo fighters to be integrated into state security forces. The presidential election scheduled for October 15 will go ahead as planned.
President Armando Guebuza is constitutionally barred from running for a third term, and Dhlakama is expected to seek the nation's highest office.
Renamo has lost every election to Frelimo since the end of a 17-year civil war in 1992.