South Sudan celebrated a new peace deal on Wednesday as fervent hopes of an end to a conflict that has killed hundreds of thousands of people were tempered by widespread scepticism that the fragile agreement will hold.

The deal, which is meant to end a civil war that began in 2013, commits forces loyal to President Salva Kiir, and the rebel groups fighting them, to sharing power.

Speaking at a ceremony in Juba, the capital, Kiir offered an unprecedented apology for a conflict that “was a complete betrayal to our people and the liberation struggle”.

“As your president, I want to apologise on behalf of all the parties for what we have caused you, our people … I deeply regret the physical and psychological wounds you have had … Today marks the end of the war in the Republic of South Sudan,” he said.

Riek Machar, the leader of the country’s biggest coalition of rebel fighters, returned to Juba for the first time since 2016 to take part in a ceremony involving singers, flags and drums staged before regional dignitaries.

“We came … for peace and … to end the suffering of people,” Machar said on his arrival at Juba’s airport. He was accompanied by his wife and a small retinue, but none of his troops.

A man waves flags during peace celebrations in Juba, the South Sudanese capital. Photograph: Bullen Chol/AP

Many analysts and aid groups fear the agreement, though backed by regional powers, will not halt ongoing violence.

“It’s the same model that spectacularly failed before, without the reasons for that failure being addressed,” said Alan Boswell, senior analyst at the International Crisis Group.

Peter Martell, a journalist and author of a recently published book on South Sudan, said there was “every reason to expect this to collapse like past agreements” but that the country was “often surprising”.

Machar, who under the terms of the peace deal is to be reinstated as vice president, fled Juba two years ago pursued by helicopter gunships when an earlier peace accord collapsed amid allegations of a coup attempt.

Hundreds died in battles between troops loyal to the two rivals, and tens of thousands more were killed in the offensives that followed. A vast proportion of the casualties were civilians.

“We really pray that this peace agreement holds this time,” said Juma Khamis, 27, who was in the crowd watching the ceremony near the mausoleum of national hero John Garang - the same spot where the country celebrated its independence from Sudan in 2011 after decades of north-south war fuelled by oil, ethnicity and religion.

Sunday Rose, 20, was selling tea at the event and called upon leaders to commit themselves to peace.

“Let our leaders see our suffering. We have suffered a lot as citizens but, with peace signed, we will be able to recover all the things we have lost,” she said.

It was not immediately clear if Machar, 65, will remain in Juba, as his aides have expressed concerns over his safety in the city.

“We are worried for his security in Juba, but the truth is here: we are for peace, and what we are trying to do is build trust. So that is why he is able to leave his forces behind and just go with politicians,” said Lam Paul Gabriel, a spokesman for Machar’s SPLM-IO rebel group, said.

Kiir said he had ordered the release of an imprisoned South African adviser to Machar and a rebel group spokesman as part of the deal.

The peace agreement was signed in the Ethiopian capital Addis Ababa in September. However, though it has regional support, there has been little backing from major international powers.

Any workable deal will require significant external funding for monitoring and investment, and so that powerbrokers can be given incentives to lay down arms. A lack of trust has prevented this, Boswell said.

Sudanese president Omar al-Bashir walks alongside South Sudanese counterpart Salva Kiir at Juba international airport. Photograph: Akuot Chol/AFP/Getty Images

South Sudan gained its independence with significant support from senior officials and celebrities such as George Clooney. The Trump administration has shown little interest in the country’s worsening plight.

The fighting and atrocities have exacerbated ethnic divisions and caused one of the world’s deepest humanitarian crises.

Experts say the conflict has now degenerated into chaos, with different factions, militia and self-defence groups battling for a share of what is left of South Sudan’s resources.

“The deal has got the backing of Uganda and Sudan, who have long been the puppet-string pullers, and that is some reason for optimism,” said Martell. “But the level of carnage has been on a scale that has exceeded even the worst nightmares, and pulling people back together will take decades. The level of hatred and anger mean a war that no one has any control of, let along men in suits in Juba.”

Fighting has been continuing in the western Bahr el Ghazal and Central Equatoria regions, the UN said last week.

The UN has previously accused government forces and allied militias of potential “war crimes”.

According to the UN human rights office, at least 232 civilians were killed and 120 women and girls raped during an offensive between 16 April and 24 May in the country’s Unity state, with three commanders identified as bearing the “greatest responsibility” in the violence.

Among the victims was a six-year-old who, said investigators, was gang-raped by soldiers, and elderly and disabled villagers who were burned alive in their huts.

A spokesman for the South Sudanese army said it would respond once the military leadership had received the report.

A third of the population has been displaced and two-and-a-half million people forced into exile as refugees. Those remaining have endured repeated bouts of deadly famine.