Israel and the Hamas militant group edged closer to a ceasefire Tuesday to end a weeklong Israeli offensive in the Gaza Strip, but after a day of furious diplomatic efforts involving the U.S. secretary of state, UN chief and Egypt's president, a deal remained elusive and fighting raged on both sides of the border.

Israeli tanks and gunboats pummeled targets in Gaza in what appeared to be a last-minute burst of fire, while at least 200 rockets were fired into Israel. As talks dragged on near midnight, Israeli and Hamas officials, communicating through Egyptian mediators, expressed hope that a deal would soon be reached, but cautioned that it was far from certain.

"If there is a possibility of achieving a long-term solution to this problem by diplomatic means, we prefer that. But if not, then I am sure you will understand that Israel will have to take whatever actions are necessary to defend its people," Israeli Prime Minister Benjamin Netanyahu said at a late-night meeting with visiting U.S. Secretary of State Hillary Rodham Clinton.

Clinton was hastily dispatched to the region by President Barack Obama to join a high-profile group of world leaders working to halt the violence. Standing alongside the Israeli leader, Clinton indicated it could take some time to iron out an agreement.

"In the days ahead, the United States will work with our partners here in Israel and across the region toward an outcome that bolsters security for the people of Israel, improves conditions for the people of Gaza and moves toward a comprehensive peace for all people of the region," she said.

Clinton expressed sorrow for the heavy loss of life on both sides, but called for the Palestinian rocket attacks on Israel to end and stressed that the American commitment to Israel's security is "rock solid."

"The goal must be a durable outcome that promotes regional stability and advances the security and legitimate aspirations of Israelis and Palestinians alike," she said.

Israel launched the offensive on Nov. 14 in a bid to end months of rocket attacks out of the Hamas-run territory, which lies on Israel's southern flank. After assassinating Hamas' military chief, it has carried out a blistering campaign of airstrikes, targeting rocket launchers, storage sites and wanted militants.

The campaign has killed more than 130 Palestinians, including dozens of civilians, and wounded hundreds of others. Five Israelis have been killed by rocket fire, including a soldier and a civilian contractor on Tuesday.

Diplomats seek end to violence

With Israel massing thousands of ground troops on the Gaza border, diplomats raced throughout the region in search of a formula to halt the fighting.

A damaged residential building is seen in the Israeli central city of Rishon Lezion, near Tel Aviv, Tuesday. It was hit by a rocket fired from the Gaza Strip. (Oded Balilty/Associated Press)

In a meeting with Netanyahu, UN chief Ban Ki-moon condemned Palestinian rocket attacks, but urged Israel to show "maximum restraint."

"Further escalation benefits no one," he said.

Israel demands an end to rocket fire from Gaza and a halt to weapons smuggling into Gaza through tunnels under the border with Egypt. It also wants international guarantees that Hamas will not rearm or use Egypt's Sinai region, which abuts both Gaza and southern Israel, to attack Israelis.

Hamas wants Israel to halt all attacks on Gaza and lift tight restrictions on trade and movement in and out of the territory that have been in place since Hamas seized Gaza by force in 2007. Israel has rejected such demands in the past.

Egypt plays key role

Egypt's new Islamist government is expected to play a key role in maintaining a deal. The crisis has thrust Egypt's president, Mohammed Morsi, into the spotlight as he plays a difficult balancing act.

Morsi belongs to the Muslim Brotherhood, Hamas' parent movement, and clearly sympathizes with the Islamic militant group. At the same time, he relies heavily on U.S. aid and is trying to preserve a historic peace agreement with Israel.

Earlier, Morsi raised hopes that a ceasefire was near when he predicted the negotiations would yield "positive results" during the coming hours.

Netanyahu also said his country would be a "willing partner" in a ceasefire agreement.

Smoke rises after what witnesses said was an Israeli airstrike in Gaza City on Tuesday. (Mohammed Salem/Reuters)

But as the talks stretched into the evening, it became clear that a deal remained a ways off.

"Most likely the deal will be struck tomorrow. Israel has not responded to some demands, which delayed the deal," Hamas official Izzat Risheq said. Hamas officials refused to discuss the remaining sticking points.

Israeli media quoted Defence Minister Ehud Barak as telling a closed meeting that Israel wanted a 24-hour test period of no rocket fire to see if Hamas could enforce a truce.

Palestinian officials briefed on the negotiations said Hamas wanted assurances of a comprehensive deal that included new border arrangements — and were resisting Israeli proposals for a phased agreement. The officials spoke on condition of anonymity because they were not authorized to talk to the media.

Although Israel claims it has inflicted heavy damage on militants' capabilities, its roughly 1,550 airstrikes and shelling attacks have failed to halt the rocket fire.

[IMAGEGALLERY galleryid=3366 size=small]

More than 1,400 rockets have been fired at Israel, including about 200 on Tuesday. A U.S.-financed Israeli rocket-defence system has knocked down roughly 400 of the incoming projectiles.

Violence raged on as the talks continued. An airstrike late Tuesday killed two journalists who work for the Hamas TV station, Al-Aqsa, according to a statement from the channel. A third journalist, from Al Quds Educational Radio, a private station, also was killed.

The Al-Aqsa TV cameramen were in a car hit by an airstrike, Gaza health official Ashraf al-Kidra said. Israel claims that many Hamas journalists are involved in militant activities. Earlier this week it targeted the station's offices, saying they served as a Hamas communications post.

Late Tuesday, a Palestinian rocket hit a house in the central Israeli city of Rishon Lezion, wounding two people and badly damaging the top two floors of the building, police spokesman Micky Rosenfeld said.

Minutes before Ban's arrival in Jerusalem from Egypt, Palestinian militants fired a rocket toward Jerusalem, just the second time it has targeted the city. The rocket fell in an open area southeast of the city.

Jerusalem had previously been considered beyond the range of Gaza rockets — and an unlikely target because it is home to the Al-Aqsa Mosque compound, Islam's third-holiest shrine.

Israeli warplanes dropped leaflets on several Gaza neighbourhoods asking residents to evacuate and head toward the centre of Gaza City along specific roads. The army "is not targeting any of you, and doesn't want to harm you or your families," the leaflets said. Palestinian militants urged residents to ignore the warnings, calling them "psychological warfare."

Israeli security officials acknowledge they rely on a network of Palestinian informants to identify targets. Masked gunmen publicly shot dead six suspected collaborators with Israel in a large Gaza City intersection Tuesday, witnesses said.

An Associated Press reporter saw a mob surrounding five of the bloodied corpses shortly after the killing, and one of the bodies was dragged through the streets by a motorcycle.

Hamas did not provide any evidence against the alleged collaborators.

Clinton was also scheduled to meet with Palestinian President Mahmoud Abbas in the West Bank and Egyptian leaders in Cairo on Wednesday. Turkey's foreign minister and a delegation of Arab League foreign ministers travelled to Gaza on a separate truce mission.

Airstrikes continued to hit Gaza even as they entered the territory.

"Turkey is standing by you," Turkish Foreign Minister Ahmet Davutoglu told the Hamas prime minister in Gaza, Ismail Haniyeh. "Our demand is clear. Israel should end its aggression immediately and lift the inhumane blockade imposed on Gaza."

The U.S. considers Hamas, which has killed hundreds of Israelis in suicide and other attacks, to be a terror group and does not meet with its officials. The Obama administration blames Hamas for the latest eruption of violence and says Israel has the right to defend itself. At the same time, it has warned against a ground invasion, saying it could send casualties spiralling.