Fires are seen following an Israeli airstrike in Gaza City on July 16, 2022. AFP
The exchange of fire came hours after US President Joe Biden visited Israel and the occupied West Bank.
"A short while ago, IDF fighter jets struck a military site in the central Gaza Strip belonging to the Hamas terrorist organisation," a statement from the Israel Defense Forces said.
"The military site consists of an underground complex containing raw materials used for the manufacturing of rockets," it said, describing the facility as "one of the most significant" of its kind in the territory.
"The strike on this site will significantly impede and undermine Hamas' force-building capabilities," it said, adding that Israel was responding to "attacks from the Gaza Strip on Israeli territory".
During the night there had been two separate launches, each of two rockets, towards Israeli territory, the military said.
Warning sirens alerting residents to the rocket fire had sounded during the night in the city of Ashkelon and elsewhere in Israel's south.
Israel's military said one of the rockets had been intercepted while the other three fell on empty land.
Impoverished Gaza, home to 2.3 million Palestinians, has been under Israeli blockade since 2007 when the Islamist movement Hamas seized power.
Before flying to Saudi Arabia on Friday, Biden visited the Israeli-occupied West Bank where he reiterated his administration's commitment to a two-state solution to end the Israeli-Palestinian conflict.
There "must be a political horizon that the Palestinian people can actually see", Biden said.
"I know that the goal of the two states seems so far away," he said in Bethlehem, alongside Palestinian president Mahmud Abbas.
Abbas said "recognising the state of Palestine" is the key to peace.
With Israeli-Palestinian peace negotiations moribund since 2014, the US delegation has been focusing on economic measures.
Biden announced an additional $200 million for the United Nations agency serving Palestinian refugees, which saw funding cut by the previous US president Donald Trump.
During a visit earlier Friday to a hospital in Israeli-annexed east Jerusalem, Biden pledged a $100 million aid package for medical institutions in the area.
He also announced plans to roll out infrastructure for 4G internet across the Gaza Strip and the West Bank by the end of next year, fulfilling a longstanding aspiration among Palestinians.
Biden earlier held talks in Jerusalem with Israeli Prime Minister Yair Lapid, during which a focal point was Iran's nuclear programme and that country's support for Hamas and other Islamist groups.