Image copyright other Image caption Hundreds of thousands of Tamils ended up trapped in a tiny strip of land

The United Nations failed in its mandate to protect civilians in the last months of Sri Lanka's bloody civil war, a leaked draft of a highly critical internal UN report says.

"Events in Sri Lanka mark a grave failure of the UN," it concludes.

The government and Tamil rebels are accused of war crimes in the brutal conflict which ended in May 2009.

The UN's former humanitarian chief, John Holmes, has criticised the report.

Mr Holmes said the UN faced "some very difficult dilemmas" at the time and could be criticised for the decisions it had taken.

"But the idea that if we behaved differently, the Sri Lankan government would have behaved differently I think is not one that is easy to reconcile with the reality at the time," he told the BBC's Newshour programme.

The UN does not comment on leaked reports and says it will publish the final version.

The 26-year war left at least 100,000 people dead. There are still no confirmed figures for tens of thousands of civilian deaths in the last months of battle. An earlier UN investigation said it was possible up to 40,000 people had been killed in the final five months alone. Others suggest the number of deaths could be even higher.

Events in Sri Lanka mark a grave failure of the UN to adequately respond... during the final stages of the conflict and its aftermath, to the detriment of hundreds of thousands of civilians UN internal review panel

Former senior UN official Charles Petrie, who headed the internal review panel, told the BBC the "penultimate" draft the BBC has seen "very much reflects the findings of the panel". He is now in New York to present the report to the UN Secretary General Ban Ki-moon.

Sources say a brief executive summary, which sets out the panel's conclusions in stark terms, has been removed in a final report which will number about 30 pages, with additional detailed annexes.

UN spokesman Martin Nesirky told the BBC the UN does not comment on leaked reports. He said a final version would be published once the secretary general had received and read it.

Senior UN sources say Ban Ki-moon is determined to act on its wide-ranging recommendations in order to "learn lessons" and respond more effectively to major new crises, such as Syria, now confronting the international community.

Analysis The final months of the war saw hundreds of thousands of Tamil civilians - 330,000, according to the UN Panel of Experts (PoE) report of 2011 - trapped in the territory held by the Tamil Tigers (LTTE). As the LTTE retreated from the government advance, they forced the civilians to come with them. According to the PoE most, though by no means all, of the civilian deaths were caused by government shelling. The Tigers shot people trying to escape and continued forcible conscription. The government rejected the report. The only international organisation left in the shrinking rebel zone was the International Committee of the Red Cross. Four days before the war ended the ICRC spoke of an "unimaginable humanitarian catastrophe". Most of the media were completely excluded from the north. Five doctors in the rebel area who reported the casualty situation to the media were imprisoned by the government and in July 2009 paraded before the media and mysteriously recanted, saying fewer than 700 civilians died from January to May - a figure much lower than that the government this year admitted to.

'Systemic failure'

The UN's investigation into its own conduct during the last months of the conflict says the organisation should in future "be able to meet a much higher standard in fulfilling its protection and humanitarian responsibilities".

The report does highlight the positive role played by some UN staff on the ground and the secretary general, but it points to a "systemic failure".

The panel questions decisions such as the withdrawal of UN staff from the war zone in September 2008 after the Sri Lankan government warned it could no longer guarantee their safety.

Benjamin Dix, who was part of the UN team that left, says he disagreed with the pullout.

"I believe we should have gone further north, not evacuate south, and basically abandon the civilian population with no protection or witness," Mr Dix told the BBC.

"As a humanitarian worker, questions were running through my mind 'what is this all about? Isn't this what we signed up to do?'"

Hundreds of thousands of Tamil civilians remained in the war zone, exploited by both sides: forcibly recruited by Tamil Tigers or used as human shields; or under indiscriminate government fire.

"We begged them, we pleaded with them not to leave the area. They did not listen to us," said a Tamil school teacher now seeking asylum in Britain, who did not want to be named. "If they had stayed there, and listened to us, many more people would be alive today."

Media playback is unsupported on your device Media caption The 26-year war left at least 100,000 people dead (This report was first broadcast in May 2009)

Despite a "catastrophic" situation on the ground, this report bluntly points out that in the capital Colombo "many senior UN staff did not perceive the prevention of killing of civilians as their responsibility - and agency and department heads at UNHQ were not instructing them otherwise".

It says there was "a sustained and institutionalised reluctance" among UN personnel in Sri Lanka "to stand up for the rights of people they were mandated to assist".

'Culture of trade-offs'

I fear this report will show the UN has not lived up to the standards we expect of it and has not behaved as the moral conscience of the world Edward Mortimer, Former senior UN official

Citing detailed records of meetings and reports, the review highlights how the UN did not publish mounting civilian casualty figures even though a detailed annex makes clear there was a "rigorous methodology."

Under intense pressure from the Sri Lankan government, it also did not make public that "a large majority" of deaths were caused by government shelling. The government repeatedly denied it shelled civilian areas.

How did the UN failure happen? The report explores at length how senior staff in Colombo "had insufficient political expertise and experience in armed conflicts and in human rights... to deal with the challenge that Sri Lanka presented", and were not given "sufficient policy and political support" from headquarters.

It also points to the Sri Lankan government's "stratagem of intimidation", including "control of visas to sanction staff critical of the state".

The result was a UN system dominated by "a culture of trade-offs" - UN staff chose not to speak out against the government in an effort to try to improve humanitarian access.

Image copyright JOE KLAMAR/AFP Image caption Hundreds of thousands of Tamil civilians were caught in the war zone

The UN spokesman in Colombo at the time says the organisation's staff felt bullied by the Sri Lankan government, and that there was a "genuine fear" for their safety.

The decision to withhold casualty figures was a result of the difficulties of operating in the country, added the spokesman, Gordon Weiss.

"It was an institutional decision not to use those [casualty lists] on the basis that those could not be verified and of course they couldn't be verified because the government of Sri Lanka wasn't letting us get anywhere near the war zone," Mr Weiss told BBC's Newshour programme.

Edward Mortimer, a former senior UN official who now chairs the Sri Lanka Campaign for Peace and Justice, says UN staff left when the population needed them more than ever.

"I fear this report will show the UN has not lived up to the standards we expect of it and has not behaved as the moral conscience of the world," Mr Mortimer said.

"There was a responsibility to protect in Sri Lanka but unfortunately it didn't get publicity like in Libya. The north of Sri Lanka was destroyed field by field, street by street, hospital by hospital but we didn't get that kind of reaction - Sri Lanka doesn't have much oil and isn't situated on the Mediterranean."

In Colombo, many senior UN staff did not perceive the prevention of killing of civilians as their responsibility UN internal review panel

The executive summary of the draft highlights how "the UN struggled to exert influence on the government which, with the effective acquiescence of a post 9/11 world order, was determined to defeat militarily an organisation designated as terrorist".

The separatist Tamil Tigers, or LTTE, are a proscribed terrorist organisation in many capitals.

UN 'chose silence'

There were no UN peacekeepers in Sri Lanka but this report says the UN should have told the world what was happening, and done more to try to stop it.

In New York, "engagement with member states regarding Sri Lanka was heavily influenced by what it perceived member states wanted to hear, rather than by what member states needed to know if they were to respond".

During the last months of war, there was not a single formal meeting of the Security Council or other top UN bodies.

Frances Harrison, author of the book Still Counting the Dead on the last months of the war, told the BBC "the only way now for Ban Ki-moon to restore the UN's tattered credibility on Sri Lanka is to call an independent international investigation into the slaughter of tens of thousands of civilians in 2009".

"The UN chose to remain silent about potential war crimes," says the former BBC Sri Lanka correspondent.

A former UN official said the establishment of a panel, headed by Mr Petrie who is known for his outspoken views, is a sign "at least part of the UN is very serious about dealing with its failure in Sri Lanka".