Three Israeli soldiers were injured by Palestinian gunfire near the Gaza border early Thursday, sparking the heaviest cross-border fighting in weeks.

An officer and two soldiers were hit by fire by a Palestinian gunman who crossed the border into Israel, according to the Israeli military.

The gunman was shot and killed by Israeli soldiers, the army said, adding that it also hit a Hamas post in the area with tank fire.

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

The attacker was armed with a rifle and grenades and wearing a Hamas uniform, according to the IDF. However, an army spokesperson said the military believes the attacker was acting alone and not on orders from Hamas.

Last month the IDF said a misunderstanding led its troops to kill a member of the Hamas terror group as he was trying to prevent Palestinian youths from breaching the security fence. That highly irregular acknowledgment of such a mistake appeared to be an effort by the Israel Defense Forces to calm tensions with Hamas and prevent another round of violence.

Wednesday’s gunman was named by Gaza media as Hani Abu Salah, a member of the military wing of Hamas whose brother was killed in a clash with the IDF last May.

דיווחים בעזה: המחבל שנהרג הוא האני אבו סלאח מהזרוע הצבאית של חמאס. על פי הדיווחים, אחיו נהרג מאש צה"ל בהפגנות הגדר במאי שנה שעברה@galberger pic.twitter.com/eDTIvtBszu — כאן חדשות (@kann_news) August 1, 2019

There was no immediate comment from Hamas, a terror group which is the de facto ruler in the Strip.

The Israeli soldiers were taken to Soroka hospital in Beersheba with non life-threatening injuries. The officer was receiving care for moderate injuries while the two lightly wounded soldiers were released shortly after their arrival.

The army said the incident began after troops were deployed to investigate the suspected gunman as he neared the Gaza border fence.

Palestinians had earlier reported heavy fighting near Khan Younis in the southern Gaza Strip.

Video purportedly from the scene published by Palestinian news outlets showed flares fired into the sky, apparently by Israeli troops, to light the battlefield. Local residents also reported hearing heavy gunfire.

حدث أمني شرقي #خانيونس مقطع فيديو متداول لتبادل إطلاق النار شرقي خانيونس بين المقاومة وجيش الاحتلال وسط تحليق كثيف لطائرات الاستطلاع وإطلاق قنابل إنارة פורסם על ידי ‏شهاب‏ ב- יום רביעי, 31 ביולי 2019

There were also reports of Israeli aircraft in the area.

The army said it closed roads near the border and deployed extra troops to communities near the border during the firefight.

The flareup of violence broke several weeks of relative calm along the normally restive border.

The beginning of 2019 saw a dramatic increase in the level of violence along the Gaza border, with near nightly riots and airborne arson attacks, but the violence has waned in recent weeks due to a de facto ceasefire agreement between Israel and the Gaza-ruling Hamas terror group.

On Wednesday, Israel wrapped up a four-day drill meant to prepare for the possibility of war with fighters based in the Palestinian enclave.

During the drill troops took to the streets of the city of Ashkelon in the middle of the night to simulate Gaza’s urban environment.

Other scenarios included a possible terrorist attempt to take over Ashkelon and other locations via the sea; the evacuation of casualties in helicopters; the evacuation of residents from their homes; and taking over a neighborhood in the Strip.

Wednesday also saw the first fire in two weeks sparked in Israel by an incendiary balloon launched from Gaza, according to authorities.