Updated

Two rockets fired by Palestinian militants struck southern Israel on Sunday, Israel's military said, violating an informal truce even as Israel and Gaza's Hamas rulers appeared to hurry closer to a long-term cease-fire deal two days before Israeli elections.

The Gaza Strip's strongman was in Syria, consulting with his Hamas bosses about the truce talks, while Israel's defense minister warned Israelis they would have to pay a painful price as part of any deal. The flurry of activity came just two days before Israelis elect a new government expected to take a harder line in talks with the Palestinians.

Israel unilaterally ended a blistering, three-week offensive in Gaza, meant to halt years of rocket fire on southern Israeli communities, last month. Some 1,300 Palestinians were killed, according to Gaza health officials, and the government said 13 Israelis also died. Vast areas of Gaza were destroyed or heavily damaged. Hamas announced its own cease-fire the same day.

Click to view photos from the conflict.

While Egypt has been trying to broker a long-term cease-fire, sporadic violence has persisted. In separate attacks, Palestinian rockets exploded in the Nir Am communal farm and the southern city of Ashkelon. No injuries were reported, though cars and buildings were damaged, authorities said.

There was no immediate claim of responsibility for either attack.

With Israeli elections approaching Tuesday, both sides appeared to be racing to reach some sort of arrangement. Polls show that Israel's next government would be much more hawkish than the current coalition, adding urgency to seal a deal.

Israel wants militants to halt their attacks, end arms smuggling into Gaza and release an Israeli soldier Hamas has held captive for more than 2 1/2 years.

Hamas wants an end to Israel's economic blockade of Gaza, which has severely restricted the movement of goods since Hamas seized power in June 2007. It also has demanded the release of more than 1,000 Palestinian prisoners held by Israel in return for the soldier, Sgt. Gilad Schalit. Hundreds of the prisoners have been involved in deadly attacks on Israel, and their release would likely generate unease if not outright controversy.

Mahmoud Zahar, Hamas' Gaza strongman, was in the Syrian capital, Damascus, on Sunday to discuss truce prospects with the group's exiled leadership. Israel allowed Zahar, who had been in hiding since the Israeli offensive, to leave Gaza on Saturday.

Mohammed Nazzal, a member of Hamas' exiled leadership, said Hamas would not rush an agreement just because of the Israeli election.

"We do not set our agenda according to others' calendars or schedules, meaning that we are not concerned about the Israeli elections ... we are concerned about signing a decent deal," he told al-Jazeera. He also said there was nothing new to report in the Schalit case.

Speaking to reporters in Israel, Israeli Defense Minister Ehud Barak said he was doing his utmost to bring Schalit home.

"We're not talking about hocus-pocus in which we roll the dice and get Gilad Schalit in return for a nice smile or a gesture," he said. "In the end, attached to it is a heavy and painful price that we'll have to decide on."

In a separate radio interview, Barak said he did not think Schalit would be home in time for Israel's parliamentary election, but hoped he would be freed by the time the current government's tenure ends in several weeks.

Rafi Eitan, another Cabinet minister, told Army Radio there is a "high probability" that a deal with Hamas, including an agreement over Schalit, will be reached before the government leaves office. He did not elaborate.

Prime Minister Ehud Olmert tried to lower expectations, saying media reports in recent days of an impending release were "overblown and damaging."

In Gaza, the Palestinian Center for Human Rights demanded an investigation into the death of a man who appeared to have been tortured by Hamas. The man was not believed to be affiliated with any opposition group.

Rights groups frequently charge that Gaza's Hamas rulers use detentions and beatings to intimidate opponents. A Hamas official said the matter is under investigation.