President Filipe Nyusi and Renamo leader Ossufo Momade embrace after signing of accord to end armed hostilities.

Mozambique‘s president and the leader of Renamo, a former rebel movement-turned-opposition party, have signed a peace accord to end armed hostilities.

Thousands of Renamo’s remaining fighters are disarming just weeks before a visit by Pope Francis and a national election scheduled for mid-October that will test the now-political rivals’ new resolve.

President Filipe Nyusi and Renamo leader Ossufo Momade shook hands and embraced after the signing on Thursday.

In an address to parliament on Wednesday, where he announced that the signing ceremony would take place at Renamo’s remote military base in the Gorongosa mountains, Nyusi said: “The agreement that we will sign marks the official end of the conflict between Renamo armed men and the defence and security forces, and allow for the long-lasting peace that all Mozambicans have so longed for.”

The signing brings an end to a long peace negotiation process initiated by Renamo’s former leader, Alfonso Dhlakama, who died in May last year.

Starting in the late 1970s, Renamo fought a brutal 16-year civil war against the Frelimo government that left one million people dead before the fighting stopped in 1992.

Despite the end of the civil war and the group transforming into a political party, it retained an armed wing.

Fresh clashes then erupted again between government forces and Renamo soldiers from 2013 to 2016.

Since 2016, the government and Renamo have been in talks, which continued after Dhlakama died from a suspected heart attack.

Momade, who took over from Dhlakama, was expected to fly from Gorongosa to the capital, Maputo, after the signing ceremony, the first time he visits the capital in many years.

Momade was elected legislator for the northern Nampula province in the 2015 general elections but only attended a few parliamentary sessions in the early months.

On Monday, parliament approved a new amnesty law for all crimes committed during the conflict between the government and Renamo since 2014.

The law offers clemency to Renamo fighters who attacked civilians and government facilities. It also paves the way for Momade to leave his mountain hideout.

Justice Minister Joaquim Verissimo on Monday told parliament that the law was aimed at “political stability and to guarantee an effective and long-lasting peace”, as well as ensure “mutual trust” and help with “national reconciliation”.

On Tuesday, Renamo began disarming its members as part of the peace deal that will see the fighters reintegrated into the country’s army and police.

More than 5,200 Renamo fighters are expected to surrender their weapons to the government, a condition for the peace deal to be signed on August 1.