Israel on Tuesday launched its largest offensive in the Gaza Strip in nearly two years, carrying out a blistering aerial assault on scores of targets and killing 25 people in what officials called an open-ended operation aimed at ending weeks of heavy rocket fire.

As Gaza militants unleashed salvos on cities including Jerusalem and Tel Aviv, Israel mobilized forces along the border for a possible ground invasion.

The offensive set off the heaviest fighting between Israel and the Islamic militant group Hamas since an eight-day battle in November 2012. The militants fired about 160 rockets at Israel, including a strike that reached the northern city of Hadera for the first time, while Israel said it attacked more than 150 sites across Gaza.

80676922

The Iron Dome air-defence system fires to intercept a rocket over the city of Ashdod, Israel, on Tuesday. In the past three weeks, more than 130 rockets were reportedly fired from Gaza into Israel. (Ilia/Yefimovich/Getty Images)

Palestinian medics reported at least 25 dead, including six killed in an airstrike that flattened an apartment building in southern Gaza and set off widespread panic.

Prime Minister Benjamin Netanyahu said continued rocket attacks on Israeli communities would not be tolerated. "Therefore I have ordered the military to significantly broaden its operation against Hamas terrorists and against the other terrorist groups inside Gaza," he said on national TV. "I call on you to display patience because this operation could take time."

Israel and Hamas are bitter enemies that have engaged in numerous rounds of fighting over the years.

But until recently, they had been observing a truce that ended the previous hostilities in 2012.

Tensions have been rising since Palestinian militants kidnapped three Israeli teenagers in the West Bank on June 12. Accusing Hamas of being behind the abductions, Israel launched a crackdown on the group's members in the West Bank and arrested hundreds of people.

Hamas, which controls Gaza, responded by stepping up rocket fire.

Residents flee

The situation deteriorated last week after the bodies of the Israeli youths were found, and a Palestinian teenager in Jerusalem was abducted and burned to death in what Palestinians believe was a revenge attack. Six Jewish Israelis have been arrested in the killing, and the rocket fire from Gaza has increased in recent days.

PALESTINIANS-ISRAEL/

Israeli residents take cover in a concrete pipe used as a bomb shelter, as a siren warning of incoming rockets is sounded in the southern community of Nitzan, near Ashdod, on Tuesday. (Finbarr O'Reilly/Reuters)

The fighting raged throughout the day. In its fiercest attack, an airstrike flattened the home of a Hamas militant in the southern Gaza town of Khan Younis, reducing the concrete structure into a smouldering pile of rubble.

Panicked residents fled, shouting "God is great." Some had bloody faces, and crying mothers held small children as they ran away. Screaming Palestinians took away motionless bodies.

Palestinian medical officials said six people, including two children, were killed. Israel's military said it had called the home shortly before the airstrike to warn civilians to leave, something it has done in past fighting as well.

The normally bustling streets of Gaza City were deserted late Tuesday. Fearing an Israeli ground operation, many residents from areas near the border moved to stay with relatives living deeper inside Gaza.

Israel intercepts 2 rockets

In southern Israel, hundreds of thousands of citizens were ordered to stay close to home because of the rockets. Israeli streets were also quieter in Tel Aviv and Jerusalem after attempted rocket strikes set off air-raid sirens in Israel's two largest cities. The Jerusalem municipality said it was opening special bomb shelters.

Nic6346807

A Palestinian medic tends to an injured person into Gaza City's al-Shifa hospital following an Israeli air strike on July 08, 2014 . Israeli warplanes pounded Gaza with more than 50 strikes after Hamas militants fired scores of rockets over the border, dragging the two sides towards a major conflict. (Mohammed Abed/AFP/Getty Images)

Militants twice fired rockets at Tel Aviv, Israel's commercial capital, sending people scurrying for cover.

Both were intercepted by the "Iron Dome" rocket defence system, with the second shown on live TV, as a winding plume of smoke followed the interceptor into the black skies, culminating with a flash.

Late Tuesday, Hamas said it fired four rockets toward Jerusalem, and two distant booms were heard from the city's centre. Three rockets landed in the Jerusalem area, officials said, and police said there were no injuries.

The Israeli military said one rocket exploded in the northern Israeli city of Hadera, about 100 kilometres from Gaza, in the farthest distance a rocket from Gaza has reached so far. It caused no injuries, the army added. With its new reach, Hamas’s rockets now have an estimated 5 million people — more than half of Israel's population — in range.

Hamas said it had used a new rocket called the R-160 after one of its leaders, Abdel Rantisi, who was killed last decade.

International community

Canadian Foreign Affairs Minister John Baird condemned the attacks by Hamas.

Mideast Israel Palestinians

A member of Israeli security forces looks at the damage to a chicken farm from a rocket fired from Gaza Strip on July 7, 2014. About a dozen rockets were fired at Israel from Gaza overnight the military said. (Tsafrir Abayov/Associated Press)

Baird said in a statement that rocket attacks aimed at Tel Aviv and Jerusalem "prove that Hamas continues to target innocent civilians."

The U.S. State Department condemned the rocket fire on Israeli civilians, defended Israel's right to protect itself, and said it hoped Israel's "strong message" would deter further attacks. "But certainly, our preference is to de-escalate the situation on the ground," spokeswoman Jen Psaki said.

United Nations Secretary-General Ban Ki-moon, meanwhile, demanded an immediate halt to the rocket attacks, UN spokesman Stephane Dujarric said. While Arab League Chief Nabil Elaraby called for an emergency session of the UN Security Council to stop the violence.