It was not immediately known who fired the rockets
Israel targeted Hamas in air strikes on Gaza early Saturday after rockets were fired at it from the Palestinian enclave, the army said, two days after a fragile ceasefire began.
Hamas, the Islamist movement that has de facto control over the Gaza Strip, had been spared the brunt of Israeli bombardment during this week's flare-up which focused on its hardline ally Islamic Jihad.
A ceasefire has been in place since Thursday morning following the wave of tit-of-tat air strikes and rocket fire between Israel and Islamic Jihad - the territory's second most powerful militant group.
The army said it launched Saturday's strikes after "two rockets were fired from the Gaza Strip towards Israeli territory" and were intercepted by air defences.
It was not immediately known who fired the rockets.
Palestinian security sources said the Israeli strikes were aimed at two Hamas sites in the north of the territory.
"Among the sites targeted was a military camp of the Hamas terror organization and a military compound used by the Hamas naval forces," a statement from the Israeli military said.
"In addition an underground terror infrastructure was also targeted."
There were no reports of casualties.
It was the first time Hamas had been hit since this week's escalation began with Israel's targeted killing of a top Islamic Jihad commander early on Tuesday.
That strike triggered almost immediate retaliatory rocket fire from Islamic Jihad, which set off air-raid sirens and sent Israelis rushing to bomb shelters in the country's southern and central regions.
The Israeli military said around 450 rockets were fired at its territory during the fighting and air defences intercepted dozens of them.
The military responded with air strikes it said targeted Islamic Jihad militant sites and rocket- and missile-launching squads.
After two days of fighting which killed 34 Palestinians and no Israelis, a ceasefire was agreed.
But it has so far been precarious, with fire coming from both sides after the agreement went into effect.
There have been three wars since 2008 between Israel and Palestinian militants in the blockaded territory which is home to some two million people.
Israeli analysts said that the focus on Islamic Jihad rather than Hamas earlier this week was a clear signal that the army sought to avoid a major new conflict.
Hamas repeatedly said it would not abandon its ally, but keeping out of the fighting helped it maintain a fragile truce with Israel that has seen tens of millions of dollars in Qatari aid flow into Gaza since last year.
It was criticized in Gaza for not joining the fighting.
Likewise, Israeli Prime Minister Netanyahu came under fire from political rivals at home for not holding Hamas accountable for attacks from the territory it rules.
The violence came at a politically sensitive time for Israel, with no new government in place since a September election ended in deadlock.
On Thursday, Israeli military spokesman Jonathan Conricus told reporters that the army had "wanted to keep Hamas out of the fighting."
"Throughout the operation, we of course distinguished between Hamas and Islamic Jihad, and all of our operations were measured, proportionate and focused only on military assets belonging to Islamic jihad," he said.
But there was a marked shift in tone in Saturday's statement.
The military said it "holds the Hamas terror organization responsible for events transpiring in the Gaza Strip and emanating from it."
"Hamas will bear the consequences for actions against Israeli civilians."