TEL AVIV, May 12 (Reuters) - Hostilities between Israel and Hamas escalated overnight, with 35 Palestinians killed in Gaza and three in Israel in the most intensive aerial exchanges for years.

Israel carried out hundreds of air strikes in Gaza into the early hours of Wednesday, as the Islamist group and other Palestinian militant groups fired multiple rocket barrages at Tel Aviv and Beersheba.

One multi-story residential building in Gaza collapsed and another was heavily damaged after they were repeatedly hit by Israeli air strikes. Israel said it attacked Hamas targets, including intelligence centres and rocket launch sites.

It was the heaviest offensive between Israel and Hamas since a 2014 war in Gaza, and prompted international concern that the situation could spiral out of control.

U.N. Middle East peace envoy Tor Wennesland tweeted: "Stop the fire immediately. We're escalating towards a full scale war. Leaders on all sides have to take the responsibility of de-escalation.

"The cost of war in Gaza is devastating & is being paid by ordinary people. UN is working w/ all sides to restore calm. Stop the violence now," he wrote.

Into the early hours of Wednesday morning, Gazans reported their homes shaking and the sky lighting up with Israeli attacks, outgoing rockets and Israeli air defence missiles intercepting them.

Israelis ran for shelters or flattened themselves on pavements in communities more than 70 km (45 miles) up the coast and into southern Israel amid sounds of explosions as interceptor missiles streaked into the sky.

Hamas's armed wing said it fired 210 rockets towards Beersheba and Tel Aviv in response to the bombing of the tower buildings in Gaza City

In Tel Aviv, air raid sirens were heard around the city. For Israel, the militants' targeting of Tel Aviv, its commercial capital, posed a new challenge in the confrontation with the Islamist Hamas group, regarded as a terrorist organisation by Israel and the United States.

The violence followed weeks of tension in Jerusalem during the Muslim fasting month of Ramadan, with clashes between Israeli police and Palestinian protesters in and around Al-Aqsa Mosque, on the compound revered by Jews as Temple Mount and by Muslims as the Noble Sanctuary.

These escalated in recent days ahead of a – now postponed - court hearing in a case that could end with Palestinian families evicted from East Jerusalem homes claimed by Jewish settlers.