Mozambique's government and the ex-rebel group Renamo completed a long-awaited peace pact on Tuesday, inking a final deal aimed at ending years of conflict.
President Filipe Nyusi and Renamo leader Ossufo Momade embraced after signing the landmark agreement at a ceremony in Maputo's Peace Square witnessed by former presidents and regional and continental leaders.
The pact, named the Maputo Peace and Reconciliation Agreement, brought the curtain down on marathon negotiations initiated by Afonso Dhlakama, the historic leader of the Mozambique National Resistance (Renamo), who died in May last year.
President Nyusi said Mozambique would "never be a theatre of war".
"The process we have created is irreversible. We don't want to see war again," he said.
For his part Momade pledged to "maintain peace and national reconciliation", describing the moment as "the beginning of new era".
He also paid tribute to his predecessor Dhlakama, who he said was "our hero who died without witnessing this agreement".
The UN's special envoy on Mozambique, Mirko Manzoni, said it was a "truly historic day".
"This agreement will bring ultimate peace in a country that has seen enough suffering," he declared.
The deal comes just two months before general elections on October 15 that the ruling Frelimo party, the dominant political force for more than four decades, is expected to win.
"Peaceful elections should be the rule rather than the exception," said the Renamo leader, whose party has disputed previous elections results.
Renamo, founded as an anti-communist guerrilla group, unleashed a civil war against the Marxist Frelimo government shortly after independence from Portugal in 1975.
The brutal fighting - seen by many historians as a proxy conflict between East and West during the Cold War - lasted 16 years.
Around million people died, many of them in a famine in 1984-5, and the country was devastated economically and left littered with landmines.
The war ended when the Soviet Union and apartheid-era South Africa scaled back their respective support for Frelimo and Renamo, leading to direct peace talks.
The rebel movement then entered politics after a 1992 peace pact which was signed in Rome, paving the way for multi-party elections in 1994.
Renamo lost that vote and subsequent elections and became the official opposition party, although it retained an armed wing.
But in October 2013, Renamo renounced the 1992 peace deal after the military raided its bush camp in central Sathundjira.
Clashes erupted again between government forces and Renamo soldiers, lasting until 2016.
On August 1, the two rivals signed a precursor accord in Gorongosa National Park under which they formally agreed to end military hostilities.
"This agreement will be successful because it is peace made by Mozambicans and for Mozambicans. A break with the past," said Manzoni.
Among the leaders who attended Tuesday's ceremony was President Cyril Ramaphosa of the neighbouring economic powerhouse of South Africa and President Paul Kagame of Rwanda.
"The signing of this agreement will pave the way for peaceful elections," Ramaphosa said.
Portugal, the former colonial power, expressed "deep satisfaction" at what it called a "new chapter opening today".
"This agreement, the result of a long negotiation process, represents fundamental progress in building peace," the foreign ministry said in Lisbon.
Last week Renamo began disarming armed members as part of the peace deal.
Some of the demobilised fighters will be absorbed into Mozambique's army and police, while others will be reintegrated into civilian life.
More than 5 200 Renamo fighters are expected to surrender their weapons to the government.
But the party is suffering internal divisions.
A small group of disgruntled members is vowing not to turn in their arms and refusing to recognise the new leader Momade, who has already been nominated as Renamo's presidential candidate for the October elections.
Tuesday's signing also comes as Nyusi's government is battling a jihadist insurgency in the north that has claimed more than 250 lives since October 2017.
Analysts doubt the peace deal will hold for long.
"It is an agreement just to make elections possible," said Domingos do Rosario, political science lecturer at the Eduardo Mondlane University in Maputo.
"Neither Nyusi nor Ossufo have sufficient power to enforce the terms of these agreements because they are very contested in their own parties," he added.