Israel's defence chief on Thursday ordered the army to use "all necessary means" to strike at Gaza militants firing mortars and rockets, as a shaky, three-month-old truce threatened to unravel.

A Hamas leader in Gaza said the militant group remained committed to the de facto ceasefire but would respond to any Israeli attacks.

Defence Minister Shaul Mofaz's orders followed the worst day of fighting in Gaza since the sides declared a ceasefire in February. Israel on Wednesday launched its first air strike in months in response to mortar attacks on Jewish settlements.

But Israeli security sources said any response to Palestinian attacks would be measured to avoid a serious escalation in Gaza that could complicate a planned Israeli withdrawal from the occupied coastal territory in mid-August.

Mofaz gave the army a freer hand to deter Palestinian fire, which continued for a second day with several makeshift rockets hitting southern Israel but causing no damage or casualties.

A Hamas man was killed on Wednesday in an Israeli missile strike on a cell firing mortars at nearby settlements. A second Hamas fighter was killed under disputed circumstances. One settler was slightly wounded in a mortar attack.

"Hamas is still committed to calm and the issue is linked to Israeli attacks. If they are repeated, we will respond and if they stop, we will stop," Mahmoud a-Zahar, a Hamas leader in Gaza, told reporters. The Israeli security sources said the new rules could enable tougher action, including further air strikes, but were also intended to pressure Palestinian President Mahmoud Abbas to rein in Hamas, which increasingly has challenged his authority.

Since the truce, the army has been under strict orders to hold its fire without authorisation from senior officials.