Israeli tanks fired on Hamas positions in Gaza on Tuesday night after a rocket was fired from the Palestinian enclave towards Israel, the Jewish state's military said.

"Late in the evening a rocket was launched from the Gaza Strip into Israeli territory," the army said in a statement on WhatsApp.

"In response Israeli tanks struck Hamas positions" in the south of the Gaza strip, it said.

An earlier military statement on the rocket said that warning sirens were not activated in built-up areas, indicating the projectile fell on open ground.

There were no immediate reports of casualties.

It was the second rocket attack in as many days.

Early Monday, militants in the Gaza Strip fired two rockets towards the Israeli coastal city of Ashdod with Israeli military sources indicating they had dropped into the Mediterranean Sea.

Israel responded a few hours later with fighter planes striking Hamas facilities in southern Gaza.

Palestinians in Gaza and the Israeli-occupied West Bank are heading for legislative and presidential elections in May and July, the first in 15 years.

The polls are part of a warming of ties between Hamas and Palestinian president Mahmud Abbas's West Bank-based Fatah party.

The dates were announced on Friday in a presidential decree by Abbas.

In late December, Hamas and Islamic Jihad staged joint military exercises in the coastal territory, during which they fired rockets out to sea, in the first exercise of its kind.

The Palestinian forces also simulated various combat scenarios with Israeli troops, an AFP reporter said.

The events marked the anniversary of the first Hamas war with Israel in 2008, a year after the Islamists took power in Gaza.

Since then they have fought two more wars, in 2012 and 2014.