The UN chief's announcement came shortly after nine people, seven of them schoolchildren, were injured in an Israeli air raid on Khan Yunis, a city in the southern Gaza Strip.
Israel seemed to be targeting a Palestinian fighter on a motorcycle, witnesses told Al Jazeera. There have been a series of raids on Gaza in recent days despite the Israeli government calling a unilateral ceasefire to end the fighting on January 17.
'Upset and angered'
Ban said there would be an "independent investigation to look into the case of [the]Unrwa compound bombing".
The bombing set fire to warehouses, destroying badly-needed food and medical aid.
UN officials say they have evidence that white phosphorous, a smokescreen agent that can cause severe burns, was used in the attack on the UN relief agency's main building in Gaza that left three people injured.
"I myself saw and visited this compound, which has been destroyed by Israeli forces. It was just, again, unacceptable, and I was very much frustrated and upset and angered by what I had seen," Ban said.
Israel said Hamas fighters had used the compound to launch attacks on its forces but later apologised for the incident.
A total of 53 installations used by the United Nations Relief and Works agency were damaged or destroyed during Israel's Gaza campaign including 37 schools - six of which were being used as emergency shelters - six health centres, and two warehouses.
Ban's investigation will be separate from one that the UN Human Rights Council has launched into alleged violations of humanitarian law during the fighting, but he did not give details on who will carry it out and when.
Raanan Gissin, an adviser to Ariel Sharon, a former Israeli prime minister, said that Israel has nothing to hide and called for any investigation to examine Hamas's conduct during the war.
"In the 22 days of the war they used their own people as human shields. This is the largest hostage situation in world history," he said.
"Israel exercised its right to self-defence, taking great care not to harm civilians.
"Hamas has used Unrwa camps - in which armed men are not allowed, according to the UN Charter - to deploy their own weapons and fighters and brought in other people, so that when Israel fired it was turned into a crime scene and a smoking gun was pointed at Israel."
The Security Council has yet to take a position on the UN investigation, but Susan Rice, the new US ambassador to the body, said on Thursday that Israel should carry out its own investigation into possible abuses by its forces.
"We expect Israel will meet its international obligations to investigate and we also call upon all members of the international community to refrain from politicising these important issues," she said.
"We expect Israel will meet its international obligations to investigate and we also call upon all members of the international community to refrain from politicising these important issues"
US ambassador to UN
In her debut speech at the UN Security Council in New York, Rice also said that Hamas was guilty of violating international law "through its rocket attacks against Israeli civilians in southern Israel and the use of civilian facilities to provide protection for its terrorist attacks".
George Mitchell, the US special envoy to the Middle East, is in the region as part of efforts to promote peace between Israel and the Palestinians.
But he warned that there could be setbacks.
"The tragic violence in Gaza and in southern Israel offers a sobering reminder of the very serious and difficult challenges and unfortunately the setbacks that will come," he said.
More than 1,300 Palestinians, including 44 civilians sheltering at a UN-run school housing refugees, were killed during Israel's war on Gaza. Thirteen Israel citizens also died during the conflict.
The African Union has joined the number of international bodies condemning Israel's attacks on Gaza.
The 53-member African body called on Friday for the United Nations to investigate allegations that Israel violated human rights in a series of "massive, indiscriminate and disproportionate" raids.
In Davos on Thursday, Ban also announced an international appeal to raise $613m to help rebuild Gaza.
He said the appeal for funds covered the requirements of the UN and other organisations for the next six to nine months, providing aid such as medical care and clean water.
Egypt's foreign ministry said on Friday that the country will host an international conference in March aimed at raising $2bn for the reconstruction of Gaza.
The ministry said the conference will be "organised in co-ordination" with the Palestinian Authority, which is led by Mahmoud Abbas, the Palestinian president and leader of Fatah - Hamas' main rival.