The UN has sacked the commander of its peacekeeping force in South Sudan following a report showing he failed to protect civilians from rape and murder.

Hundreds were killed in heavy fighting in the capital of Juba in July as forces loyal to President Salva Kiir clashed with those of vice president Riek Machar with helicopter gunships and tanks.

The report from a UN special investigation found lack of leadership in the UN mission culminated in a "chaotic and ineffective response" to the fighting.

Peacekeepers abandoned their posts and failed to respond to pleas for help from aid workers under attack in a nearby hotel compound, according to a summary of the report.

Around a dozen aid workers and UN staff housed at the Terrain hotel compound were attacked by South Sudanese soldiers on 11 July, but the peacekeepers failed to come to their aid despite being less than a mile away.

In pictures: Hundreds killed in South Sudan clashes Show all 12 1 /12 In pictures: Hundreds killed in South Sudan clashes In pictures: Hundreds killed in South Sudan clashes The clashes began when uniformed personnel opened fire at a meeting of the governing party, the Sudan People's Liberation Movement Benjamin Lowy/Getty Images In pictures: Hundreds killed in South Sudan clashes Civilians queuing outside the UNMISS compound in Bor, South Sudan AFP/UNMISS/Rolla HinediRolla In pictures: Hundreds killed in South Sudan clashes The mission is stepping up provision of basic health facilities AFP/UNMISS/Rolla HinediRolla In pictures: Hundreds killed in South Sudan clashes South Sudanese civilians fleeing an outbreak of intense fighting between groups of government forces take shelter at the United Nations Mission to South Sudan base in Juba, South Sudan Benjamin Lowy/Getty Images In pictures: Hundreds killed in South Sudan clashes South Sudan's fugitive former vice president denied accusations he led a coup bid against his archrival President Salva Kiir after days of fierce fighting that has killed hundreds of people and sent thousands fleeing to UN bases Benjamin Lowy/Getty Images In pictures: Hundreds killed in South Sudan clashes An injured man sits in a shelter at the United Nations Mission in Juba, South Sudan Benjamin Lowy/Getty Images In pictures: Hundreds killed in South Sudan clashes French UN ambassador Gerard Araud, who holds the rotating presidency of the Security Council, confirmed that up to 20,000 people had taken refuge in the UN mission in Juba Benjamin Lowy/Getty Images In pictures: Hundreds killed in South Sudan clashes Fighting in South Sudan has claimed up to 500 lives in recent days Benjamin Lowy/Getty Images In pictures: Hundreds killed in South Sudan clashes Former Finance Minister Kosti Manibe, former Justice Minister John Luk Jok and former Interior Minister Gier Chuang Aluong were among the 10 people arrested Benjamin Lowy/Getty Images In pictures: Hundreds killed in South Sudan clashes South Sudan's President Salva Kiir gestures during a news conference in Juba. Kiir said he was ready for dialogue with his rival who he has accused of trying to force him out of power through fighting that has killed up to 500 people and brought the two-year-old nation close to civil war Reuters/Goran Tomasevic In pictures: Hundreds killed in South Sudan clashes South Sudan has struggled to achieve a stable government since becoming independent from Sudan in 2011. The independence referendum was intended to end a decade-long conflict, led by the Sudan People's Liberation Movement, against the north. But the oil-rich country remains ethnically and politically divided, with many armed groups active Benjamin Lowy/Getty Images In pictures: Hundreds killed in South Sudan clashes People arrive to seek refuge in the UNMISS compound in Juba Stringerstr/AFP/Getty Images

During the attack, "civilians were subjected to and witnessed gross human rights violations, including murder, intimidation, sexual violence and acts amounting to torture perpetrated by armed government soldiers," the report said.

One victim said a soldier pointed an AK-47 at her and delivered an ultimatum: "Either you have sex with me, or we make every man here rape you and then we shoot you in the head." She was raped by 15 South Sudanese soldiers.

There were multiple requests to the peacekeepers from China, Ethiopia, India and Nepal for forces to be dispatched, but each contingent "turned down the request, indicating their troops were fully committed".

Loading....

The mission, known as UNMISS, has 16,000 troops deployed in South Sudan, which has been at war since December 2013. It was led by Lieutenant General Johnson Mogoa Kimani Ondieki of Kenya, who had been the force commander since May.

UN spokesman Stephane Dujarric said: "The special investigation found that UNMISS did not respond effectively to the violence due to an overall lack of leadership, preparedness and integration among the various components of the mission."

Mr Ban said he was "deeply distressed by these findings" and "alarmed by the serious shortcomings" of the UN mission.

The UN chief "has asked for the immediate replacement of the force commander," Mr Dujarric said.

UN urges South Sudan to accept more peacekeepers

The inquiry found Chinese peacekeepers abandoned their positions at least twice and Nepalese peacekeepers failed to stop looting inside the UN compound.