JERUSALEM (CNN) -- Palestinian militants and the Israeli military traded violent attacks Wednesday, a day before a truce was scheduled to take effect, according to the Israeli military and Hamas.
An Israeli soldier directs a tank onto a flatbed truck close to the Gaza border Wednesday ahead of the cease-fire.
Palestinian militants fired more than two dozen rockets and mortars on southern Israel, but there were no casualties, the Israeli military said.
Israeli aircraft responded by targeting two rocket-launching sites in northern Gaza, according to the Israel Defense Forces.
One of the airstrikes killed an Islamic Jihad militant and injured four others, Hamas sources in Gaza said.
Hamas officials said Tuesday they had reached an agreement with Israel for a six-month cease-fire -- to take effect at 6 a.m. Thursday. Israel did not confirm the deal until Wednesday morning. Egyptian mediators helped to negotiate the agreement.
Militants in Gaza have launched more than 2,300 mortars and rockets since the year's beginning, while 2,000 were fired in all of 2007, according to Israeli military figures. Watch how violence continues in Gaza »
While most of the attacks do not result in casualties, three Israelis have been killed in rocket and mortar strikes in recent weeks.
The Israeli military responds to the attacks by carrying out airstrikes and ground operations in Gaza that target militants. Those operations have led to more than 360 Palestinian deaths in Gaza this year through the end of May, according to the Israeli human rights group B'Tselem.
More than 40 percent of those deaths were civilians, according to B'Tselem. The increase in civilian deaths -- 156 during the first five months of the year, compared with 91 in all of 2007 -- has further inflamed the Palestinian leadership.
On Tuesday, the Israeli government expressed hope the truce would stop the cycle of violence.
"We are hopeful that this will lead to a cessation of the daily rocket fire from [the] Gaza Strip that Israelis have endured for so long," said Israeli government spokesman David Baker.
On Sunday, Israel gradually will start to open its border crossings, Hamas officials said.
A key factor in any successful truce, from the Israeli perspective, would be the release of Cpl. Gilad Shalit, an Israeli soldier whom Gaza militants kidnapped in June 2006.
Egypt has been trying to broker a truce between Hamas and Israel for months.
Referring to the Egyptian mediation efforts, Israeli Defense Minister Ehud Barak said, "It's important to exhaust the possibility.
"The IDF is prepared for any developments, but it is important to attempt to achieve a period of calm to bring back the peace and quiet for the [Israeli] people who live around Gaza in Sderot and Ashkelon and to try and renew negotiations for the release of Gilad Shalit."
Also Wednesday, Israel called on Lebanon to open direct peace talks between the two countries, said a spokesman for Israeli Prime Minister Ehud Olmert.
"Israel wants peace with Lebanon. We are currently negotiating with the Syrians and with the Palestinians, and there is no logical reason whatsoever why we can't negotiate with the Lebanese," said Olmert spokesman Mark Regev.
Regev said Israel "is interested in direct bilateral talks where every issue of contention will be on the table."
This comment came as Israel and longtime foe Syria hold indirect peace talks in Turkey.
Israel has never had formal diplomatic relations with Lebanon. It fought a war in Lebanon two years ago against the militant Shiite group Hezbollah and another one during the 1980s against Palestinian militants based there.
Israel has formal diplomatic relations with two other nations on its border, Egypt and Jordan.
CNN's Shira Medding and Atika Shubert contributed to this report.