Mozambique’s president and the leader of the country’s main opposition group signed a new peace accord Tuesday, pledging to end years of violence and facilitate elections in the fall.

In signing the Peace and National Reconciliation Agreement, President Filipe Nyusi and Renamo leader Ossufo Momade said they would peacefully participate in Oct. 15 elections.

Portuguese news agency Lusa said the signing ceremony in Mozambique’s capital of Maputo was witnessed by five African heads of state, including South African President Cyril Ramaphosa.

Thousands of Maputo residents also attended the ceremony in Peace Square, including many children wearing T-shirts printed with the phrase “Ultimate Peace.”