The UN secretary general, looking distressed, described the devastation of Gaza as "heartbreaking" on a visit to the area after the 22-day Israeli assault.

"I have seen only a fraction of the destruction," said Ban Ki-moon, as he stood in front of a UN warehouse set on fire by Israeli shells last Thursday. "This is shocking and alarming. These are heartbreaking scenes I have seen and I am deeply grieved by what I have seen today." he said.

Mr Ban demanded a full investigation into the Israeli shelling of the UN Relief and Works Agency compound. UN officials say the compound, still smouldering yesterday, was targeted by white phosphorus munitions which are not supposed to be used in densely populated areas because of the harm to civilians. Mr Ban said the Israeli attacks on UNRWA headquarters and two UN schools in Gaza, one of which killed 40 sheltering Palestinians, were "outrageous".

Amnesty International said Israel's repeated use of the munitions despite evidence of their indiscriminate effects and harm to civilians "is a war crime". The Israeli army has launched an investigation but says Hamas fighters operate from densely populated areas, and used UN buildings as cover for attacks.

Mr Ban said: "It has been especially troubling and heartbreaking for me as secretary general that I couldn't end this faster," he said. He urged Israel and Hamas to "exercise maximum restraint and nurture the ceasefire".