Thousands of Palestinian residents of the northern Gaza Strip fled their homes and sought safety in United Nations shelters.

They were heeding warnings from the Israeli military about impending plans to bomb the area in the sixth day of an offensive against Hamas that has killed more than 160 people.

The fighting showed no signs of slowing, despite international calls for a ceasefire and growing concerns about the mounting civilian death toll in Gaza.

Netanyahu and John Kerry at a joint press conference at the Israeli Prime Minister's Office in December.

Netanyahu and John Kerry at a joint press conference at the Israeli Prime Minister’s Office in December.

US Secretary of State John Kerry spoke to Israeli Prime Minister Benjamin Netanyahu and voiced US “readiness” to help restore calm, while Egypt, a key mediator between Israel and Hamas, continued to work behind the scenes.

UN Secretary-General Ban Ki-moon called for an immediate ceasefire, saying he “strongly believes that it is in the interest of both sides that steps toward dangerous escalation be replaced with immediate measures to end the fighting, thus preventing further casualties and greater risks to regional peace and security”.

He condemned Hamas’ indiscriminate firing of rockets against Israeli civilian targets as “a violation of international law”.

Amid the diplomacy, Israel said it was pushing forward with preparations for a possible ground invasion of Gaza. Thousands of troops have massed along the border in recent days.

“We don’t know when the operation will end,” Mr Netanyahu told his Cabinet. “It might take a long time.” He said the military was prepared “for all possibilities”.

Israel launched the offensive last Tuesday in what it said was a response to heavy rocket fire out of Hamas-controlled Gaza.

The military says it has launched more than 1,300 airstrikes, while Palestinian militants have launched more than 800 rockets at Israel.

The Palestinian Health Ministry in Gaza says 166 people have been killed, including dozens of civilians.

An Israeli soldier prays near a 155mm M109 Dores self-propelled howitzer positioned along the southern Israeli border with the Gaza Strip, on July 13, 2014.

An Israeli soldier prays near a 155mm M109 Dores self-propelled howitzer positioned along the southern Israeli border with the Gaza Strip, on July 13, 2014.

There have been no Israeli fatalities, though several people have been wounded, including a teenage boy who was seriously injured by rocket shrapnel yesterday.

Early yesterday, the Israeli air force dropped leaflets around the northern Gaza town of Beit Lahia ordering people to evacuate their homes.

Israel says much of the rocket fire has come from the area, and the military carried out a brief ground operation on what it said was a rocket-launching site that could not be struck from the air. Four Israeli soldiers were slightly wounded before returning to Israel.

The UN refugee agency for Palestinians, UNRWA, said some 17,000 Palestinians had headed to special shelters set up in 20 United Nations schools in Gaza.

“The fact that in a span of almost a few hours, 10,000 people sought refuge in these 15 schools is an indication to the difficult situation on the ground,” said Sami Mshasha, a UNRWA spokesman.

Some raced by in pick-up trucks, waving white flags. “Once we received the message, we felt scared to stay in our homes. We want to leave,” said one resident, Mohammed Abu Halemah.

Shortly before nightfall, Israel carried out a series of airstrikes in the northern Gaza town of Beit Lahia. Hamas’ Al-Aqsa TV station reported four airstrikes in a 10-minute span, and a large plume of black smoke could be seen over the area from the Israeli border. There were no immediate reports of casualties.

Hamas, an Islamic militant group sworn to Israel‘s destruction, has remained defiant, and it continued to fire rockets into Israel throughout the day.

It urged people in northern Gaza to stay in their homes and has so far rejected proposals for a ceasefire as unsatisfactory.

“They want us to put down our arms and leave the resistance,” said Moussa Abu Marzouk, a senior Hamas official.

“They started the battle, and we will stay on our land and fight to protect our future.”

Despite Israeli claims that it has inflicted heavy damage on the group, Hamas says it is largely unscathed, and Palestinian medics say most of the dead have been civilians.

The outbreak of violence follows the kidnappings and killings of three Israeli teenagers in the West Bank, the kidnapping and killing of a Palestinian teenager in an apparent revenge attack, and wide-ranging Israeli moves against Hamas militants and infrastructure in the West Bank.

Hamas has demanded that hundreds of recently arrested activists be freed as part of a cease-fire.

Many of the airstrikes have been on the homes of wanted Hamas militants, putting their families at risk. In an attack on Saturday, the target of one such airstrike, Gaza’s police chief, survived, while 17 members of his extended family were killed.

Israel accuses Hamas of using Gaza’s civilians as human shields, putting people in the densely populated territory in danger.

Despite Israel‘s claims, the international community, including many of Israel‘s allies, have begun to express concerns about the growing civilian death toll.

In Vienna, Mr Kerry spoke to Mr Netanyahu yesterday and highlighted US concerns about the “escalating tensions,” the State Department said.

Other countries were also involved. Germany’s foreign minister said he would head to the region today, while French President Francois Hollande tried to rally Arab and Muslim leaders to push for a ceasefire.