At least five people were lightly wounded when a Palestinian man opened fire at a bus and stabbed someone near an outdoor market in the central Israeli city of Petah Tikva on Thursday evening, officials said.

Police officers later arrested the West Bank man, who was still in possession of the gun used in the attack, a police spokesperson said.

The Hamas terror group in Gaza praised the attack as a “natural result” of Israeli crimes, but did not claim responsibility. Hamas called on other Palestinians to follow the gunman’s example, Ynet reported.

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

Just before 5:00 p.m., the gunman, opened fire at a bus near the Petah Tikva market on Baron Hirsch Street. One a man in his 50s was shot in the leg, while two women — one in her 50s, the other in her 30s — were hit by shrapnel, according to the Magen David Adom ambulance service.

He was identified by Palestinian media as Sadeq Nasser Abu Mazen, 18, from Beita al-Foka, a village south of Nablus.

The Palestinian teenager used a Carlo-style submachine gun, a comparatively cheap improvised firearm, which is prevalent in the West Bank. Carlos, which are often cobbled together from water pipes and spare parts, are notoriously unreliable, and the weapon used in the attack apparently jammed multiple times.

What is normally an automatic weapon was only able to fire a shot every few seconds, according to videos from the scene. An eyewitness told Walla news that the gunmen also entered a shop and tried to open fire, but his gun wouldn’t work at all.

The incident occurred at the entrance to the city’s busy central market, which was crowded with people shopping ahead of Shabbat.

[mappress mapid=”6085″]

After shooting at the bus, the suspect continued on foot towards Hovevei Tziyon Street, running through the city’s alleyways, before he was cornered by a group of civilians outside a sewing machine repair shop, according to police officer Ami Ben-David.

The Ynet news site reported that one of the civilians used one of the shop’s sewing machines to take down the attacker. An eyewitness told Channel 2 news that he used a wood plank to hit the man as well, and said the suspect yelled in Arabic as he was tackled.

In the scuffle, a man in his 40s was stabbed in the neck with a screwdriver as he attempted to apprehend the assailant, he told medics.

After the suspected terrorist was subdued by the citizens, police officers arrived and arrested him. He was handed over to the Shin Bet security service for questioning, Ben-David said.

Alon Rizkan, one of the medics, described the scene following the attack as “chaos.” Videos from the scene show people screaming and fleeing from the scene en masse.

During the commotion that followed, another man, estimated to be in his 30s, suffered a light head wound, MDA said.

He had been set upon by a mob after the attack, as they mistook him for the terrorist responsible for the attack.

A video of the incident shows police officers leading away the Arab Israeli man, as bystanders shout curses at him. A few members of the crowd tried to strike him, but police kept them back.

One bystander defended the Arab Israeli man, telling the crowd: “He didn’t do anything. Let the man go.”

Officers reportedly arrested the man, but released him a short time later, after realizing that he had not been involved in the attack.

Three people were also treated after they suffered anxiety attacks, MDA said.

In total, eight victims were taken to Petah Tikva’s Beilinson Hospital for treatment, the ambulance service said.

A Rishon Lezion court issued a gag order on all details of the case, police said.

A spate of stabbings, car-rammings and shooting attacks by mainly Palestinian assailants that began a year ago has waned over the last six months, though sporadic incidents have persisted.

Since October 2015, 40 Israelis, two Americans, a Palestinian and an Eritrean national have been killed in stabbing, car-ramming and shooting attacks. According to AFP figures, some 250 Palestinians, a Jordanian and a Sudanese migrant have also been killed, most of them in the course of carrying out attacks, Israel says, and many of the others in clashes with troops in the West Bank and at the Gaza border, as well as in Israeli airstrikes in the Strip.

A number of attacks during the wave took place in Petah Tikva, a suburb of Tel Aviv. In March, a terrorist stabbed a man in the a wine shop in the city. The victim pulled the knife out of his neck and proceeded to stab the terrorist to death.