JERUSALEM (AP) -- Cross-border fighting between Israel and Gaza's ruling Hamas group appeared to be winding down Friday, amid reports of an Egyptian-brokered truce and Israeli media saying a misfire was believed to be responsible for the rare Gaza rocket attack on Tel Aviv that triggered the exchange.
The two rockets had struck late Thursday, taking Israel's military by surprise. Overnight, Israeli warplanes hit some 100 Hamas targets in Gaza. The army said targets included an office complex in Gaza City used to plan and command Hamas militant activities, an underground complex that served as Hamas' main rocket-manufacturing site and a center used for Hamas drone development.
In Gaza, health officials reported that four people were wounded, including a husband and wife in the southern town of Rafah. There were no further details. The office building struck by Israel had been used by Hamas' office of prisoner affairs.
On Friday, Israeli media quoted defense officials as saying a preliminary investigation indicated the rockets were fired by mistake. It was not immediately clear if it was a technical malfunction or human error. The Haaretz daily quoted the officials as saying the rockets were fired during maintenance work. The Israeli military had no immediate comment.
Also Friday, a Hamas official said an agreement to restore calm has been reached. The official, speaking on condition of anonymity because Hamas has yet to announce the deal, said Egypt led meditation efforts "that have apparently paid off."
The sudden outbreak of violence came at a sensitive time for both sides.
Israeli Prime Minister Benjamin Netanyahu is in the midst of a tight re-election battle. A tough response would draw international criticism and domestic accusations that he is acting out of political motivations ahead of the April 9 vote. But a restrained response will draw criticism from his fellow hard-line rivals.
Hamas, meanwhile, is coping with its own domestic troubles. Israel and Egypt have maintained a crippling blockade on Gaza since Hamas took over the territory in 2007. The blockade, along with sanctions by the rival Palestinian Authority and Hamas' own mismanagement have fueled an economic crisis that has driven unemployment over 50 percent.
Shortly before the rocket attack, Hamas police on Thursday violently broke up a rare protest by demonstrators angry about the dire living conditions in Gaza.
The crackdown triggered heavy criticism on social media. The organizers of a weekly protest along the Israeli border canceled the demonstration in the wake of the escalation.
The fighting came as Egyptian mediators were trying to extend a cease-fire between the bitter enemies, which last fought a war in 2014. The Egyptians left Gaza late Thursday.
Hamas, which typically claims responsibility for its military actions, denied involvement in the rocket attack on Tel Aviv and even said it had undermined its interests. Israel's military said earlier Friday that it holds Hamas responsible for all attacks coming from Gaza.
The late-night attack Thursday on Tel Aviv, Israel's densely populated commercial and cultural capital, marked the first time the city had been hit since a 2014 war between Israel and Gaza militants.
Following the first Israeli airstrikes, several additional rounds of rocket fire were launched into Israel. The military said several rockets were intercepted by its air defense systems, and there were no reports of injuries.
The initial blasts from the Israeli airstrikes in southern Gaza were so powerful that smoke could be seen in Gaza City, 25 kilometers (15 miles) to the north. The Israeli warplanes could be heard roaring through the skies above Gaza City.
Israel and Hamas are bitter enemies and have fought three wars since the Islamic militant group seized power in Gaza in 2007. Smaller flare-ups have occurred sporadically since Israel and Hamas fought their last war, in 2014.
Despite its denial, Hamas is one of the only groups in Gaza with the means to strike Tel Aviv. A smaller militant group, the Iranian-backed Islamic Jihad, also possesses a large arsenal of rockets, though it too denied involvement.