GAZA/JERUSALEM, July 20 (Reuters) - At least 40 Palestinians were killed on Sunday by Israeli shelling in a Gaza neighborhood, where bodies were strewn in the street and thousands fled toward a hospital packed with wounded, witnesses and health officials said.

The mass casualties in the Shejaia district in northeast Gaza were the heaviest since Israel launched its offensive on the Palestinian territory on July 8 after cross-border rocket strikes by militants intensified.

Anguished cries of "Did you see Ahmed?" "Did you see my wife?" echoed through the courtyard of Gaza's Shifa hospital, where panicked residents of Shejaia gathered in family groups, while inside bodies and wounded lay on blood-stained floors.

Video given to Reuters by a local showed at least a dozen mangled corpses, including three children, lying in the rubble-filled streets.

At the hospital, about 3 km (2 miles away), elderly men said the Israeli attack was the fiercest they had seen since the 1967 Middle East war, when Israel captured Gaza.

"Forty martyrs have been counted so far ... medics are searching for possibly more casualties," Naser Tattar, Shifa hospital's director, told Reuters. He said some 400 people were wounded in the Israeli attack.

Thousands fled Shejaia, some by foot and others piling into the backs of trucks and sitting on the hoods of cars filled with families trying to get away.

Asked about the attack, an Israeli military spokeswoman said: "Two days ago, residents of Shejaia received recorded messages to evacuate the area in order to protect their lives."

There were no signs of a diplomatic breakthrough toward a ceasefire, and militants kept up their rocket fire on Israel. Sirens sounded in southern Israeli towns and in the Tel Aviv metropolitan area. There were no reports of casualties.

Hamas, the dominant armed group in the Gaza Strip, had urged people across the territory not to heed the Israeli warnings and abandon their homes.

As the tank shells began to land, Shejaia residents called radio stations pleading for evacuation. An air strike on the Shejaia home of Khalil al-Hayya, a senior Hamas official, killed his son, daughter-in-law and two grandchildren, hospital officials said.

Palestinian President Mahmoud Abbas condemned "the new massacre committed by the Israeli government in Shejaia", a spokesman for the Western-backed leader said.

Israel, which has accused Hamas of using civilians as human shields by launching rockets from residential areas, sent ground forces into the Gaza Strip on Thursday after 10 days of air, naval and artillery barrages failed to stop the salvoes.

The military said it beefed up its presence on Sunday, with a focus on destroying missile stockpiles and a vast tunnel system Hamas built along the frontier that crosses into Israel.

Gaza's Health Ministry officials said at least 370 Palestinians, many of them civilians, have been killed in the 13-day conflict and about 2,600 have been wounded. On Israel's side, two civilians were killed by cross-border fire and five soldiers died as fighting occurred at close quarters.

The United Nations Works and Relief Agency (UNRWA) said more than 63,000 people have now sought sanctuary in 55 of its shelters, mostly schools, in Gaza.

The army said that since the start of the ground offensive three days ago, it had killed more than 70 militants and that troops had discovered five tunnels running under the border. It said that since July 8, it had attacked 2,570 targets, describing them as "terror sites".

TRUCE EFFORTS

Diplomatic efforts to secure a ceasefire involving, among others, Egypt, Qatar, France and the United Nations, have failed to make headway.

Qatar was due to host a meeting between Abbas and U.N. Secretary-General Ban Ki-moon on Sunday, a senior Qatari source told Reuters. Ban was due during the week to travel to Kuwait, Egypt, Israel, the Palestinian Territories and Jordan, a U.N. statement said.

The Qatari source said Abbas was also due to meet Hamas leader Khaled Meshaal.

Western-backed Abbas in April struck a deal with Islamist Hamas that led to the formation of a Palestinian unity government, seven years after the group seized control of Gaza from Abbas's Fatah party in a brief civil war.

Hamas has rejected Egyptian efforts to end fighting, saying any deal must include an end to a blockade of the coastal area and a recommitment to a ceasefire reached after an eight-day war in Gaza in 2012.

Egypt said on Saturday it had no plans to revise its ceasefire proposal. A Hamas source in Doha said the group has no plans to change its conditions for a ceasefire.

Hostilities between the two sides escalated following the killing last month of three Jewish students that Israel blames on Hamas. Hamas neither confirmed nor denied involvement.

The apparent revenge murder of a Palestinian youth in Jerusalem, for which Israel has charged three Israelis, further fueled tension.

Israel says more than 1,700 rockets have been fired out of Gaza during this month's fighting, and between 3,000 and 4,000 destroyed in military strikes - together almost half of the militants' original estimated arsenal.

Hamas says it is continuously replenishing its stock of weapons and is ready for a prolonged conflict.

The Israeli death toll has been kept low due to the rockets' relative inaccuracy, a network of air-raid sirens and shelters and the Iron Dome rocket interceptor's 90 percent success rate.

The Israeli military urged Palestinians to flee a growing area of Gaza ahead of further military action in the Mediterranean enclave. Residents say about half of the territory's 1.8 million population have been told to move.

With the Israeli and Egyptian borders sealed off, Gazans say they have few places to escape to.

The largest U.N. agency in Gaza, UNRWA, said about 61,500 people had sought refuge in its buildings, mainly schools - more than in any previous conflict there between Israel and Islamist militants. (Additional reporting by Noah Browing in Gaza and Ari Rabinovitch in Jerusalem; Writing by Jeffrey Heller; Editing by Dale Hudson)