Although Ethiopian troops appear to have withdrawn from their perimeter positions at another base, civilians said the peacekeepers helped evacuate civilian casualties and, on at least a few occasions, returned fire when fighters targeted the camp. Outside the fortified bases, however, peacekeeper presence was “non-existent”.

The failures came amid clashes in Juba between troops from the government’s Sudan People’s Liberation Army (SPLA), loyal to the president Salva Kiir, and opposition forces of his rival Riek Machar. The street battles, in which scores were killed, were the culmination of months of tension between the two factions, and resulted in the flight of Machar from South Sudan.

During four days of fighting between the rival forces, artillery rounds and gunfire hit two UN bases, killing two Chinese peacekeepers.

South Sudan’s president, Salva Kiir, with members of the UN security council in Juba last month. Photograph: Justin Lynch/AP

Civilians died inside and outside the UN bases and hundreds – possibly thousands – of women were raped, including many within view of UN bases. Aid workers were also targeted.

On the last day of the fighting, about 80 to 100 government soldiers attacked a compound in Juba where they raped and gang-raped at least five international aid workers and physically or sexually assaulted at least a dozen others, the report said.

They also killed a South Sudanese journalist, apparently because of his ethnicity, it was reported.

One UN base was only several hundred metres from the compound, but despite dozens of appeals for help from the besieged aid workers and personal visits from at least one who escaped from the compound, internal UN documents show no help was sent, the Associated Press reported in August.

The new report, based on about 100 interviews conducted in south Sudan, explains that though the UN gave orders for a peacekeepers to intervene, none “ever tried to leave their bases” with the Chinese and Ethiopian battalions refusing to go.

The UN has more than 12,500 troops from 61 countries deployed in South Sudan, which gained independence from Sudan in 2011 after decades of civil war. Under the UN’s terms of engagement, the force, which is equipped with armoured vehicles and heavy weapons, has the authority to take action to protect civilians and staff from imminent violence.

About 2,500 troops are stationed in two bases in Juba, backed by about 930 support staff and 350 police officers.

“The UN peacekeeping mission faced a challenging environment during the July violence in Juba, but it underperformed in protecting civilians inside and outside its bases,” said Federico Borello, the executive director of Civic. “To ensure that such problems are not repeated, it is critical that the UN be transparent about what went wrong and hold accountable any individuals or units that failed to live up to the protection mandate.”

Civic also called for a UN arms embargo on South Sudan, which was plunged into conflict in December 2013, when the president, Kiir, accused Machar, his former deputy, of plotting a coup.

A UN armoured personnel vehicle in a refugee camp in Juba, South Sudan. Photograph: Jason Patinkin/AP

A patchily implemented peace deal in August 2015 led to Machar’s return to the capital this year, but the agreement broke down.

The UN’s failings in July were not new, Civic said. The group previously investigated an incident in February, when peacekeepers from Ethiopia, India and Rwanda stood by as government soldiers attacked another Protection of Civilians site in the northern town of Malakal, killing at least 30 civilians.

Months later, the UN admitted to peacekeeper “inaction, abandonment of post and refusal to engage” during the Malakal attack, but failed to hold any commanders or troops to account.

Civic said the UN mission in South Sudan received inadequate support from UN headquarters and had been “repeatedly blocked, harassed, and, at times, even attacked by the parties to the conflict”.

“The UN’s failings began before guns were fired in July; the security council has not taken meaningful action to challenge the government of South Sudan as it repeatedly obstructed the movements and functioning of Unmiss.

“The mission, for its part, yielded to a situation in which, in effect, it needed [local authorities’] authorisation to perform many of its most basic protection tasks,” the report said.

UN peacekeeping officials said the report raised a number of important issues, noting that an independent investigation into the Juba violence ordered by the outgoing UN secretary general Ban Ki-moon was due to present its findings shortly.

The UN sites offering civilians refuge were “unsustainable and cannot provide a reliable option for the physical security” of tens of thousands of South Sudanese, the institution’s peacekeeping department said. “The investment we urgently need to make and prioritise in South Sudan is putting the peace process back on track,” it said.

Machar, the former vice president, is in exile in Khartoum, from where he has called for armed resistance against Kiir’s government, raising the prospect of a return to all-out civil war.

Geeska Afrika (1985-2017) is the oldest independent free press in the region. Geeska Afrika original reporting by our award-winning journalists. We also distribute news and information items daily from over 200 African news organizations. Contact at HAN@Geeskaafrika.com