TEL AVIV — The remaining two Palestinians who escaped an Israeli prison early this month were recaptured Sunday in a predawn raid, concluding a dramatic manhunt that spurred rocket fire from Gaza and raised threats of a widespread escalation in violence.

The two men arrested Sunday morning were part of a group of six Palestinian fugitives who on Sept. 6 used spoons to dig underneath their cells in the maximum-security Gilboa Prison onto a country road. The four others were rearrested last weekend in the area around Nazareth, near the prison in northern Israel.

The Israeli military said the operation to capture the two fugitives, Munadil Nafayat and Eham Kamamji, was carried out by the Israel Defense Forces (IDF), the Israeli Securities Authority and the Israeli police counterterrorism unit, which also apprehended two men who helped the men to hole up in a house in the eastern part of Jenin, a West Bank city that has for decades served as a flash point in the Israeli-Palestinian conflict.

“Over and done. All six terrorists were captured and returned to prison, in an impressive, sophisticated and rapid operation by the GSS, the police and the IDF,” tweeted Israeli Prime Minister Naftali Bennett on Sunday. “What went wrong can be repaired.”

In an interview on Sunday with the Arabic-language Israeli radio station al-Shams, Khamamji’s father said that he had received a call from his son about 2 a.m.

“He said that he decided to turn himself in to protect the building’s residents. I was completely surprised that he was in Jenin, and I thought that he already got to Gaza or Lebanon two weeks ago. But it’s his decision, and I respect it,” he said.

Clashes between Palestinian demonstrators and the Israeli military broke out during and after the rearrest of the fugitives in the Jenin area. The Israeli military said that Palestinians hurled rocks and improvised explosives and fired shots as the military was leaving. Two Palestinians were injured by live fire and were taken to the city’s hospital in moderate and stable condition, according to Palestinian media.

The four men who had been previously rearrested were given away by Palestinian citizens, spurring accusations of treason among Palestinian brethren in the West Bank, especially in Jenin, which is home to a refugee camp that is a hotbed for the militant groups Hamas and Islamic Jihad and has for decades seen lethal clashes between young Palestinian protesters and the Israeli army. On social media, West Bank Palestinians said that the residents of Nazareth and the surrounding area were no longer welcome.

“From today onward, as far as I’m concerned, Israeli Arabs . . . all their children serve in the Israeli army and work in Israeli defense companies, they’re proud of it, they wave the Israeli flag and sing ‘Hatikva,’ ” wrote Jamal Zubeidi, the uncle of Zakaria Zubeidi, one of the escaped prisoners, on Facebook.

In Gaza, Hamas attempted to capitalize on the mass Palestinian euphoria around the prison break, dubbing the men “heroes” of the “Freedom Tunnel” operation. Last weekend, rockets from Gaza were fired into southern Israel three nights in a row, and Hamas announced that it would demand the release of the six men in future negotiations with Israel.

The Israeli military, in response, struck what it said were several Hamas compounds in the Gaza Strip.

The exchange threatened a fragile cease-fire that has been in place since an 11-day conflict in May that left 13 dead in Israel and more than 250 dead in Gaza.

The prison escape incident was also an embarrassment for the Israeli security establishment, as the details of its failures became known to the public over the past two weeks. In the hours after 1:30 a.m. on Sept. 6, the men dug a hole through the foundation of their cell and emerged onto a nearby street, directly beneath a watchtower where the guard was asleep. It was later clear that the prison’s architectural firm had posted the facility’s blueprints online. When cellphone blockers were installed in September 2020, prisoners reacted with mass protests and hunger strikes, and Hamas raised objections, saying that they could harm the prisoners’ health, and the blockers were ultimately not used. No flags were raised when the men had requested to be transferred to the same cell before the escape, even though they were all from the nearby area of Jenin and three were considered to pose a high risk of escape.

The six men were classified as high-level “security prisoners” for having orchestrated a string of terrorist attacks targeting Israeli soldiers and civilians during the second intifada, or mass Palestinian uprising, during the early 2000s. Four of the men are serving life sentences. Among the most well-known is Zubeidi, who was captured last week. A former child theater actor turned militant leader, he headed the Jenin branch of the al-Aqsa Martyrs Brigades, an offshoot of Fatah, the secular group that rules the West Bank. He is on trial for more than 20 crimes, including attempted murder.

“There were a series of mistakes and failures,” Bennett said. “The amount of energy and efforts that have been invested in fixing this series of mistakes and failures that simply did not need to happen is massive.”

Nahum Menashe, the previous chief of Ramon prison, in southern Israel, told the Israeli news site Ynet that “more escapes are possible.” He said that only 20 percent of prison budgets go toward enforcing security. “We need to think about the next escape.”

Hamas spokesperson Hazem Qassam said on Sunday that the “heroes of the Freedom Tunnel . . . will remain irrefutable evidence of the fragility and weakness of the Zionist security system and its inability to withstand the will of the Palestinian fighter.”