Israel carried out a series of airstrikes on Hamas “terror targets” in the northern Gaza Strip overnight Wednesday-Thursday, the IDF said, in response to machine gun fire that struck several homes in the Israeli city of Sderot, apparently fired from across the border.

An army statement said the “terror targets belonging to Hamas” included four site on a Hamas military base and three at a weapons factory.

The strikes came in response to three separate cross-border exchanges earlier Wednesday, including shots said to have been fired from Gaza that hit residential buildings in Sderot causing damage but no injuries, the army said.

Get The Times of Israel's Daily Edition by email and never miss our top stories Free Sign Up

According to the city of Sderot, the shots from Gaza were aimed at an army aircraft that had been flying overhead, and the bullets struck the homes as they fell back down to earth.

“A short while ago, shots were fired at an [Israel Defense Forces] aircraft. Rounds hit a number of homes in Sderot,” the city said in a statement.

Earlier in the day, shots were fired at Israeli soldiers stationed on the border, according to the army. There were no reports of injuries.

In response, an IDF tank fired on a Hamas military position in the northern Gaza Strip, the military said.

A few hours after the machine gun fire hit the Sderot homes, Israeli troops on the border were again shot at, that time near southern Gaza, the army said.

In response, an Israeli tank destroyed two Hamas observation posts in southern Gaza, according to the IDF.

The bullets that hit Sderot, a city in southern Israel that has frequently been the site of rocket attacks over the past 20 years, were large caliber rounds that were fired from a heavy machine gun by members of a terrorist group in Gaza, the IDF said.

The army would not immediately comment on whether the aircraft had been hit in the shooting attack.

“The IDF sees this as a serious event and holds Hamas responsible for everything that occurs in the Gaza Strip,” the army said.

לפחות 6 בתים נפגעו מירי מקלעים מרצועת עזה לשדרות. חלון בית ניזוק pic.twitter.com/4JrhxPO2LX — matan tzuri מתן צורי (@MatanTzuri) May 16, 2018

In one case, a bullet shattered a window. In others, the rounds smashed into external walls, according to pictures of the houses posted on social media.

One of the homes hit belonged to a former mayor Sderot, Eli Moyal, who told the Ynet news site he heard a “terrible noise” and when he ran outside to see what had happened he found bullet fragments.

Police were called to the scenes, sealing off the areas around the homes that were hit as forensic investigators were called in.

The army said it was investigating the issue in order to determine the origins of the gunfire.

The two shootings followed two days of clashes along the Gaza border.

On Monday, over 40,000 Palestinians took part in “unprecedentedly” violent riots along the security fence, which included at least one gun battle with Israeli troops, as well as attempts to infiltrate into Israeli territory and to plant improvised explosive devices along the border, the army said.

On Tuesday, approximately 4,000 people rioted along the border, throwing rocks and Molotov cocktails at Israeli troops on the other side of the fence.

Gaza’s Hamas-run health ministry said 62 people were killed in the demonstrations on Monday and Tuesday, 53 of whom were later identified by the terror groups as members of Hamas or the Palestinian Islamic Jihad.

Judah Ari Gross contributed to this report.