CAIRO - Israeli tanks captured the main road dividing the eastern and western halves of Rafah on Friday, effectively encircling the entire eastern side of the city in the southern Gaza Strip.

Residents described almost constant explosions and gunfire east and northeast of the city on Friday, with intense fighting between Israeli forces and militants from Hamas and Islamic Jihad.

Hamas said it ambushed Israeli tanks near a mosque in the east of the city, a sign the Israelis had penetrated several kilometres from the east to the outskirts of the built-up area.

Israel has ordered civilians out of the eastern half of Rafah, forcing tens of thousands of people to seek shelter outside the city, previously the last refuge of more than a million who fled other parts of the enclave during the war.

Israel says it cannot win the war without assaulting Rafah to root out thousands of Hamas fighters it believes are sheltering there. Hamas says it will fight to defend it. Aid agencies say the battle puts hundreds of thousands of already displaced civilians in harm's way.

"It is not safe, all of Rafah isn't safe as tank shells landed everywhere since yesterday," Abu Hassan, 50, a resident of Tel al-Sultan west of Rafah told Reuters via a chat app.

"I am trying to leave but I can't afford 2,000 shekels to buy a tent for my family," he said. "There is an increased movement of people out of Rafah even from the western areas, though they were not designated as red zones by the occupation.

"The army is targeting all of Rafah not only the east with tank shells and air strikes."

The Israeli military said its forces in eastern Rafah had located several tunnel shafts and troops backed by an air strike fought at close quarters with groups of Hamas fighters, killing several.

It said Israeli jets had hit several sites from which rockets and mortars had been fired towards Israel in recent days, including at the Kerem Shalmon crossing point.

Israeli tanks have already sealed off eastern Rafah from the south, capturing and shutting the only crossing between the enclave and Egypt. An advance on Friday to the Salahuddin road that bisects the strip completed the encirclement of the "red zone" where they have ordered residents out.

The prospect of an assault on Rafah this week has opened up one of the biggest rifts for generations between Israel and its closest ally the United States, which has blocked shipments of weapons to Israel for the first time since the war began.

Prime Minister Benjamin Netanyahu said on Thursday Israel would "fight with our fingernails" if it must. In a U.S. television interview, he said he hoped Israel would overcome its disagreements with President Joe Biden.

Ceasefire talks broke up on Thursday with no agreement to halt the fighting and release hostages captured in the Hamas-led Oct. 7 attacks that precipitated the war.

Hamas had said it agreed at the start of the week to a proposal submitted by Qatari and Egyptian mediators that had previously been accepted by Israel. Israel said the Hamas proposal contained elements it cannot accept.

More than 34,000 Gazans have been killed in the seven months of war, according to health authorities in the Hamas-controlled enclave who say thousands more dead are probably buried under rubble. Israel launched the assault to annihilate Hamas after the Oct. 7 attacks, in which 1,200 people were killed according to Israeli tallies.

(Additional reporting by James Mackenzie in Jerusalem; Writing by Peter Graff; Editing by Andrew Heavens)