"It is an outrageous and totally unacceptable attack on the United Nations," Ban said about the destruction of UN-run buildings and schools in Gaza during Israel's 22-day war on Palestinian resistance in Gaza Strip.
Main UN Relief and Works Agency (UNRWA) compound in Gaza City in addition to the other UN buildings were hit during the fighting by Israeli forces and a number of Palestinian who had taken shelter in UN schools were killed.
The UN secretary general, during his tour of Gaza on Tuesday, expressed his anger at the devastation, saying that those who opened fire on the building should be held accountable.
There must be a full investigation, a full explanation "to make sure it never happens again. There should be accountability through a proper judiciary system," Times On-line quoted him as saying.
Ban also told reporters that he was shocked and alarmed at the destruction.
"I have seen only a fraction of the destruction," He added.
He condemned the "excessive" use of force by Israel.
Hamas held a rally outside the compound and called for international recognition of its Gaza-based government during Ban Ki-Moon's visit to Gaza.
Since the Israeli army started its onslaught on Gaza on December 27, around 1,340 Gazans were killed and over 5,500 more were wounded, including 1,855 children and 795 women.