By Nidal al-Mughrabi and Louis Charbonneau
GAZA (Reuters) - Voicing shock at stark scenes of destruction, U.N. Secretary-General Ban Ki-moon visited the Gaza Strip Tuesday, and Israel was poised to withdraw its troops before the U.S. presidential inauguration later in the day.
Ban, on a Middle East tour, was the highest-ranking international figure to visit the territory since separately declared ceasefires by Israel and Hamas ended a 22-day Israeli offensive and Palestinian cross-border rocket attacks.
"I have seen only a fraction of the destruction. This is shocking and alarming," Ban said, condemning the "excessive use" of force by Israel and militants' rocket salvoes.
"These are heartbreaking scenes I have seen and I am deeply grieved by what I have seen today," he told a news conference held against a backdrop of still smouldering food aid in a U.N. warehouse set ablaze by Israeli gunfire last Thursday.
Echoing his comments at the time, Ban called the Israeli attack on the United Nations Relief and Works Agency compound outrageous and demanded an investigation.
Israel apologised after the incident but said its forces were responding to shooting from gunmen at the United Nations Relief and Works (UNRWA) facility.
Hamas held a rally outside the compound during Ban's visit, calling for international recognition of its Gaza-based government.
The United Nations and other members of the "Quartet" of Middle East mediators -- the United States, the European Union and Russia -- have said there could be no dealings with Hamas until it recognized Israel, renounced violence and accepted existing interim peace deals.
Ban called for Palestinian reconciliation and said the U.N. would work with any united Palestinian government to rebuild the Gaza Strip.
Israeli political sources said Israel planned to complete its troop pullout before Barack Obama's inauguration, scheduled for 5 p.m. British time. Analysts saw the withdrawal as an effort to avoid any tension with the new U.S. president.
Many Palestinians returned to the rubble of what used to be their homes in Gaza city suburbs that were hard hit during the fighting. They picked through debris, trying to salvage belongings.
Two children playing with unexploded ordnance were killed when it detonated, Hamas officials said.
Ban, who met Israeli Prime Minister Ehud Olmert before travelling to the Gaza Strip, planned to visit southern Israel, an area hit by Palestinian rockets during the Gaza war, later in the day.
At the prime minister's office, Ban said he wanted to help to make the cease-fire "durable."
World leaders are keen to cement a truce and avoid any more bloodshed in Gaza where more than 1,300 Palestinians were killed in Israel's air and ground strikes launched on December 27 with the declared aim of ending rocket attacks.
Gaza medical officials said the Palestinian dead included at least 700 civilians. Israel, which accused Hamas of endangering non-combatants by operating in densely populated areas, said hundreds of militants were among the dead.
Israel had launched its offensive with a vow to "change the reality" for southern border towns that had been the target of rocket fire from Hamas and other militant groups since 2001.
Hamas seized control of Gaza from the Fatah forces of Palestinian President Mahmoud Abbas in 2007 after winning an election the year before. Israel and the West boycotted governments led by Hamas because the group rejects Israel's right to exist.
(Additional reporting by Douglas Hamilton in Gaza, Adam Entous in Jerusalem; Writing by Jeffrey Heller; Editing by Alastair Macdonald)