Guterres said he was "fully aware of the deep grievances of Palestinians after 56 years of occupation".
United Nations Secretary-General Antonio Guterres said on Wednesday that attacks by militant group Hamas on Israel did not justify the "collective punishment" of Palestinians and called for an immediate ceasefire.
Speaking at an economic forum in China, Guterres condemned the October 7 Hamas attacks on Israel that killed more than 1,400 people as "acts of terror" that could not be justified.
"But those attacks cannot justify the collective punishment of the Palestinian people," Guterres said.
He appealed for an "immediate humanitarian ceasefire" in the war between Israel and Hamas in Gaza, reiterating what he called "two urgent humanitarian appeals".
Guterres called on Hamas for the "immediate and unconditional release of hostages", referring to at least 199 people kidnapped by the militants during their offensive, the deadliest in Israel's history.
Guterres also called on Israel to "immediately allow unrestricted access of humanitarian aid to respond to the most basic needs of the people of Gaza, the overwhelming majority of whom are women and children".
"I call for an immediate humanitarian ceasefire to provide sufficient time and space to help realise my two appeals and to ease the epic human suffering we are witnessing," Guterres said.
"Too many lives and the fate of the entire region hang in the balance."
Guterres said was "fully aware of the deep grievances of the Palestinian people after 56 years of occupation".
"But as serious as these grievances are, they cannot justify the acts of terror committed by Hamas on October 7," he said.
The UN chief earlier said he was "horrified" by a deadly blast that ripped through a hospital in Gaza late Tuesday, killing hundreds of people.
Hamas has blamed Israel for the hospital strike. Israel has said it was caused by a rocket misfired by Islamic Jihad militants in Gaza.
"My heart is with the families of the victims. Hospitals and medical personnel are protected under international humanitarian law," Guterres said in a post on X.
Guterres also condemned an attack on a school run by the UN in a Gaza refugee camp that killed six people.