Militants in Gaza have fired two rockets towards Tel Aviv, the first such attack since the war between Israel and Hamas in 2014. Israel has responded by attacking what it called “terror sites” in Gaza.

Rocket sirens sounded in Tel Aviv on Thursday evening, alerting residents to rush to bomb shelters. Videos posted online by locals showed empty streets and captured the blare of “code red” sirens, used to warn of imminent attacks.

There were no reports of damage or casualties, the Israeli army said, and no group in Gaza immediately claimed the attack, but in a statement, Hamas’s military wing denied responsibility for the attack.

As well as the strip’s rulers, Hamas, other armed factions operate in the territory, including Islamic Jihad, an Iranian-backed organisation that has launched rockets in the past.

In Gaza explosions were heard in the north and south of the territory according to Palestinian witnesses who said Israeli planes bombed two Hamas security positions.

As tensions have risen in Gaza over Israel’s lethal response to weekly protests at the frontier during the past year, militants in the enclave have fired hundreds of projectiles into surrounding areas, although not as far north as Tel Aviv. Israel’s military has responded with widespread airstrikes.

Israel’s prime minister, Benjamin Netanyahu, led an urgent meeting with senior military officials after the attempted strike to discuss a response, local media reported.

Earlier on Thursday, Hamas security forces in Gaza violently dispersed hundreds of Palestinians protesting against dire living conditions. Footage of the rally showed police beating demonstrators in the streets and gunfire could be heard.

The rare public show of dissent followed recent tax hikes. Social media posts by supporters of the protest were accompanied with the hashtag “we want to live” in Arabic.

The United Nations said in 2017 that a decade after Hamas seized power, the strip had effectively become “unliveable” for its 2 million inhabitants. Trapped under a crippling Israeli-Egyptian blockade, residents suffer limited access to clean water andfresh food and have to cope with a collapsed health system.