Israel said its military would hold fire in most of the Gaza Strip for seven hours on Monday to facilitate the entry of humanitarian aid and for displaced Palestinians to return to their homes, but would fight back if attacked.

The humanitarian truce, beginning at 10 a.m. EEST (3 a.m. ET), would not apply in areas of the southern Gaza town of Rafah where Israeli forces are still operating, a Defence Ministry official said in a statement.

Israel withdrew most of its ground troops from the Gaza Strip on Sunday in an apparent winding down of the nearly month-long operation against Hamas that has left more than 1,800 Palestinians and more than 60 Israelis dead.

Even as Israel said it was close to completing its mission, heavy fighting raged in parts of Gaza, with at least 10 people killed in what UN and Palestinian officials said was an Israeli airstrike near a UN shelter. The United States lashed out at Israel, saying it was "appalled" by the "disgraceful" attack.

And with Hamas officials vowing to continue their fight, it remained uncertain whether Israel could unilaterally end the war.

Israel launched its military operation in Gaza on July 8 in response to weeks of heavy rocket fire, carrying out hundreds of airstrikes across the crowded seaside territory. It then sent in ground forces July 17 in what it said was a mission to destroy the tunnels used by Hamas to carry out attacks.

Hamas has fired more than 3,000 rockets into Israel during what has turned into the bloodiest round of fighting ever between the two enemies.

Lt.-Col. Peter Lerner, an Israeli military spokesman, confirmed the bulk of ground troops had been pulled out of Gaza after the military concluded it had destroyed most of the tunnel network.

He said Israel had detected some 30 tunnels that were dug along the border for what he called a "synchronized attack" on Israel.

"We've caused substantial damage to this network to an extent where we've basically taken this huge threat and made it minimal," he said. The army had thousands of troops in Gaza at the height of the operation.

Israeli vehicles roll back

In southern Israel, armoured vehicles could be seen rolling slowly onto the back of large flatbed trucks near the Gaza border, while soldiers folded flags from atop a tank and rolled up their belongings and sleeping bags.

Mideast Israel Palestinians

A Palestinian boy injured in an Israeli strike boy receives treatment in the Kuwaiti hospital in Rafah refugee camp, southern Gaza Strip. (Khalil Hamra/Associated Press)

Lerner said, however, that the operation was not over and that Israel would continue to target Hamas' rocket-firing capabilities and its ability to infiltrate Israel.

While Israeli Prime Minister Benjamin Netanyahu has vowed to press on against Hamas, he is coming under international pressure to halt the fighting because of the heavy civilian death toll.

UN officials say more than three-quarters of the dead have been civilians, including the 10 people killed Sunday at a UN school that has been converted into a shelter in the southern town of Rafah.

Chris Gunness, spokesperson for the United Nations Relief Works Agency in Rafah, the UN agency that assists Palestinian refugees, told CBC News on Sunday that 3,000 "displaced people" were registered in the area at the time.

"The sense of insecurity is profound and visceral because they know as they wait in their UN shelters, in these UN classrooms, that they may take direct hits because that's what has happened in previous occasions," he said, adding the incident has further "traumatized" the population of Gaza, more than half of whom are children.

"There's nowhere safe in Gaza. And that's the tragedy," he said.

UN chief, U.S. State Department condemn attack

UN Secretary General Ban Ki-moon called the attack a "moral outrage and a criminal act" and demanded a quick investigation, while the U.S. State Department condemned the strike in unusually strong language, saying it was "appalled" by the "disgraceful" shelling.

"The co-ordinates of the school, like all UN facilities in Gaza, have been repeatedly communicated to the Israeli Defense Forces. We once again stress that Israel must do more to meet its own standards and avoid civilian casualties," State Department spokeswoman Jen Psaki wrote in a statement, which also calls for a full investigation into the recent shelling of several UNRWA schools.

"The suspicion that militants are operating nearby does not justify strikes that put at risk the lives of so many innocent civilians."

According to witnesses, Israeli strikes hit just outside the main gates of the school. The Red Crescent, a charity, said the attack occurred while people were in line to get food from aid workers. Gaza health official Ashraf al-Kidra said in addition to the dead, 35 people were wounded.

'The locations of all these installations have been passed to the Israeli military multiple times.They know where these shelters are. How this continues to happen.'- Robert Turner, UN Palestinian refugee agency

Robert Turner, director of operations for the UN Palestinian refugee agency in Gaza, said the building had been providing shelter for some 3,000 people. He said the strike killed at least one UN staffer.

"The locations of all these installations have been passed to the Israeli military multiple times," Turner said. "They know where these shelters are. How this continues to happen, I have no idea."

Inside the UN school's compound, several bodies, among them children, were strewn across the ground in puddles of blood. "Our trust and our fate are only in the hands of God!" one woman cried.

The Israeli military said it had targeted three wanted militants on a motorcycle in the vicinity and was "reviewing the consequences of this strike."

In the current round of fighting, UN shelters have been struck by fire seven times. UNRWA says Israel has been the source of fire in all instances. But it also has said it found caches of rockets in vacant UNRWA schools three times.

Aerial shelling continues

CBC Middle East correspondent Sasa Petricic said the school was in a particular area that has housed "some of the most intense shelling there has been" in the southern Rafah area.

Petricic said the reports of the deaths at the school come amid a "shift in operations" and an apparent withdrawal of some Israeli ground troops out of Gaza itself. He said troops were pulling back the border area between Israel and Gaza due to the successful destruction of tunnel that Israel says are used by Hamas militants to launch attacks against Israel.

Israel accuses Hamas of using civilian areas for cover and says the Islamic militant group is responsible for the heavy death toll because it has been using civilians as "human shields."

hi-un-school.jpg

A Palestinian carries a wounded boy following what witnesses said was an Israeli air strike at a United Nations-run school, where displaced Palestinians were taking refuge. At least 10 people were killed and about 30 others wounded in the reported attack in Rafah in the southern Gaza Strip. (Ibraheem Abu Mustafa/Reuters)

Israeli artillery shells slammed into two high-rise office buildings Sunday in downtown Gaza City, police and witnesses said. Al-Kidra said more than 50 Palestinians were killed, including 10 members of one family in a single strike in the southern Gaza Strip.

Israel said that it attacked 63 sites on Sunday and that nearly 100 rockets and mortars were fired at Israel.

Also Sunday, the Israeli military said it found three motorcycles in one of the tunnels leading to Israel. It said the vehicles were meant to facilitate an attack against Israelis and help militants get around more quickly.

Israeli officials said the military would reduce its ground activities in Gaza but would respond to continued attacks from Gaza with airstrikes.

"It's not a withdrawal," Israeli Cabinet minister Amir Peretz told Channel 10 TV. "It's setting up a new line that is a more controlled line with the air force doing its work."

In Gaza, Hamas officials said they would not halt the rocket fire without an end to an Israeli blockade of the territory that has devastated the local economy. Israel imposed the blockade in 2007, saying the measures are needed to keep Hamas from arming.

"If Israel stops unilaterally, Hamas will declare victory and will not grant any security or truce to Israel," said one senior official, who spoke on condition of anonymity because he was discussing internal Hamas deliberations. "In this case, we are going to live under a war of attrition until a political solution is found."

In Cairo, Egyptian and Palestinian negotiators held talks over a potential cease-fire. After accusing Hamas of repeatedly violating humanitarian cease-fire arrangements, Israel said it would not attend the talks and there was "no point" in negotiating with the militant group.

Meanwhile, the Israeli military death toll rose to 64 after Israel announced that Hadar Goldin, a 23-year-old infantry lieutenant feared captured in Gaza, was actually killed in battle. Some 15,000 people attended his funeral Sunday.

Israeli Defence Minister Moshe Yaalon revealed on his Facebook page Sunday that he is a distant relative of Goldin and had known him his whole life. The information was previously kept under wraps while Goldin was feared abducted.

With files from CBC News, Reuters