He called for "maximum restraint on the part of the Israel defence forces".
John Holmes, the UN undersecretary-general for humanitarian affairs, said on Friday: "We all understand the security problems and the need to respond to that but collective punishment of the people of Gaza is not, we believe, the appropriate way to do that."
Holmes said the Israeli response was unwarranted.
"This kind of action against the people in Gaza cannot be justified, even by those rocket attacks," he said.
Hamas fighters killed
In the latest violence, a pre-dawn Israeli air strike north of Gaza City killed at least two Hamas fighters on Saturday, medics said.
The two men were in their 20s and members of the Ezzadine al-Qassam Brigades, the armed wing of Hamas, the medics said.
A third Hamas fighter died on Saturday from wounds suffered in an air strike on Thursday.
Later in the day, hundreds of Palestinians attended the funerals of the dead fighters.
An Israeli military spokeswoman said fighter jets carried out two strikes in northern Gaza on Saturday targeting rocket launchers, but would not specify where they took place.
Israeli soldiers also captured four Hamas fighters, and took them to Israel for questioning, according to the spokeswoman.
Hamas said the Israeli troops also arrested family members of the fighters.
More than 38 Palestinians have now been killed since Monday.
Israel bombed four other targets in Gaza on Friday - including a Hamas government building.
The office block in a crowded part of the city was reduced to rubble, killing one woman and injuring almost 50 other people.
Al Jazeera's correspondent Jacky Rowland says the Israeli onslaught in Gaza is making the position of Mahmoud Abbas, the Palestinian president, increasingly difficult.
Khalil Shaheen, a political analyst based in Ramallah in the West Bank, agrees that Abbas has been placed in an "impossible situation".
He told Al Jazeera: "He is trying to continue with negotiations while Israel is continuing attacks in the West Bank and Gaza.
"This equation will not lead anyone anywhere, and he will have to take a political stand that will put an an end to the negotiations due to the Israeli escalation of violence."
Ban joined Holmes on Friday in urging Israel to end the closure, saying it cut off the population from fuel supplies needed to pump water and generate electricity for homes and hospitals.
He said: "The closure will also cause further shortages of food, medical and relief items in the Gaza Strip."
Daniel Carmon, the deputy head of Israel's mission to the UN, told the Reuters news agency that Israel's actions were "what any responsible government would do when it is confronted as we are with this surge of violence and terrorism".
He gave no indication of when the closure would end.
Carmon said Israel was "very much aware of the humanitarian situation in Gaza".
The Israeli government has said that humanitarian goods would be allowed into the territory.
Plea to Hamas
Holmes also urged Hamas, which took control of Gaza last June, to use its authority to put an end to the attacks against Israel.
He said: "I'm calling on the Hamas leaders ... to do whatever they can to stop these attacks because they claim to be in control of Gaza there.
"Therefore they have a responsibility to stop the attacks."
|Many Palestinian civilians have been wounded|
as Israel goes after fighters in Gaza [AFP]
Holmes said he worried the violence in Gaza could spin out of control, making a dire humanitarian situation even worse.
"I believe it is a [humanitarian] crisis already," he said.
Israel has continued to push ahead with its military offensive against Palestinian fighters in both Gaza and the West Bank.
On Thursday, Ehud Olmert, the Israeli prime minister, said in a statement that his country was at "war" against fighters in the Gaza Strip.
The Israeli military has particularly intensified its operations in Gaza, with at least 32 people killed during the past week. In response, Hamas has begun firing rockets at Israel for the first time in months.
Around 230 rockets and mortars have been fired over the border since Tuesday, the Israeli military said.