By Douglas Hamilton and Nidal al-Mughrabi
TEL AVIV/GAZA (Reuters) -- Israel and the Palestinians stepped back from the brink of a new war in the Gaza Strip on Tuesday, sending signals to each other via Egypt that they would hold their fire unless attacked, after five days of mounting violence.
The tacit truce arrested an escalation to all-out fighting, but both sides remain armed and primed for another round in the unresolved conflict that has festered since Hamas Islamist militants took over the enclave in 2007.
Ismail Haniyeh, prime minister of Gaza's Hamas government, praised the main armed factions in the enclave for agreeing on Monday night to a truce.
"They showed a high sense of responsibility by saying they would respect calm should the Israeli occupation also abide by it," he said.
Haniyeh spoke during an unannounced visit to a hospital to see wounded Palestinians. Some Israeli leaders say it is time to resume the controversial tactic of assassinating Hamas leaders.
Israeli Prime Minister Benjamin Netanyahu consulted his inner circle of ministers in Jerusalem. One of them, Benny Begin, said the flare-up had subsided but the conflict was far from resolved.
"This round of firing appears to have ended and things must be looked at soberly without illusions for both sides," he said.
"Action must be taken following much thought and I think this is what the prime minister is doing," he told Israel Radio.'Time to act'
Three Palestinian fighters and four civilians have been killed by Israeli fire since Saturday, and 40 others wounded. Eight Israeli civilians were injured by some of the 115 rockets fired from Gaza and four soldiers were wounded in an anti-tank missile that hit their jeep.
An official involved in the Egyptian mediation confirmed both sides were ready to stop.
"The message was clear and Israel too told Egypt they were not interested in escalation if rocket firing stopped. The situation now is calm for calm and I hope it does not deteriorate," the official told Reuters
Israel struck three targets in the Gaza Strip in the early hours of Tuesday, including what the army said was a weapons depot and two rocket launch sites. There were no casualties.
Only one Palestinian rocket strike was reported in Israel by 10 a.m. on Tuesday.
Israeli Defense Minister Ehud Barak told reporters Israel was not prepared to forgive and forget following four days of violence.
"The matter has definitely not ended and we will decide how and when to act at the time when there will be a need," he said.
Israel has shown little appetite for a new Gaza war, which could strain relations with the new Islamist-rooted government in neighboring Egypt. The countries made peace in 1979.
But Netanyahu will be reluctant to seem weak ahead of a Jan. 22 election that opinion polls currently predict he will win.'Safety net'
Hamas is emboldened by the rise to power in Egypt of its spiritual mentors in the Muslim Brotherhood whom it views as a "safety net" that would stop an all-out Israeli onslaught.
The party believes it now presents a challenge that Israel's military superiority cannot easily best.
"This assault and other assaults by the occupation will not break the will of the Palestinian people and their steadfastness in the face of barbaric Israeli attacks," Haniyeh said.
Israel invaded Gaza in their last war in December 2008 in which 1,400 Palestinians and 13 Israelis were killed. International critics said Israel used "disproportionate force".