TEL AVIV—After a nearly two-week manhunt, Israeli security forces captured the last pair of six Palestinian militants who staged a daring escape from a high-security prison that embarrassed Israel’s security establishment and ignited a fresh wave of violence between Israelis and Palestinians.

Security forces tracked the final two escapees to a hideout in the West Bank city of Jenin before surrounding the building in a high-stakes standoff on Sunday. The two fugitives gave themselves up to avoid anyone being injured, according...

TEL AVIV—After a nearly two-week manhunt, Israeli security forces captured the last pair of six Palestinian militants who staged a daring escape from a high-security prison that embarrassed Israel’s security establishment and ignited a fresh wave of violence between Israelis and Palestinians.

Security forces tracked the final two escapees to a hideout in the West Bank city of Jenin before surrounding the building in a high-stakes standoff on Sunday. The two fugitives gave themselves up to avoid anyone being injured, according to the father of one of the prisoners.

The jailbreak transfixed both Israel and the partially Palestinian-governed West Bank and Gaza when news of the escape broke on Sept. 6.

The fugitives, five of whom were affiliated with the militant group Islamic Jihad and a number convicted on terrorism charges, dug a tunnel with improvised tools including a pen and a coat hanger down from their shower stall to foundations of the building.

The best known was Zakaria Zubeidi, who was a leader of the Al Aqsa Martyrs’ Brigade, which carried out deadly attacks on Israeli targets during a Palestinian uprising between 2000 and 2005. He was transferred into the same cell as the others the night before the escape.

After breaking through to the foundations, the prisoners crawled around 25 meters through the cavity between the earth and the building before digging their way out again through the sandstone just on the other side of the wall surrounding the Gilboa prison. It took about 20 minutes for the six men to get through the small manhole-sized passage they had dug outside the walls, with two of the escapees dragging one of their larger cellmates through the gap, according to Natan Dublin, spokesman for Israel’s Public Security Minister Omer Balev.

He said a 19-year-old army conscript posted to a nearby watchtower should have spotted the six prisoners making their getaway, but she was asleep.

It wasn’t until a taxi driver called police to report suspicious-looking figures lurking in the area that Israeli officials became aware of the mistake.

Prime Minister Naftali Bennett, who took office in June, quickly came under fire for the debacle. His predecessor, Benjamin Netanyahu, accused him of putting political survival ahead of national security.

Palestinians at a news conference in Gaza last week to show solidarity with prisoners in Israeli jails.

Photo: Omar Ashtawy/APA Images/Zuma Press

Many Palestinians, meanwhile, saw the jailbreak as a blow against the Israeli state and feted the fugitives as heroes. Palestinian militants fired rockets into Israel from their bases in Gaza each time a fugitive was caught. Other Palestinians with no known militant affiliations carried out a series of stabbing attacks in Jerusalem and against Israeli soldiers in the West Bank.

“The escape itself was a severe mishap—operational, systemic and vis-à-vis intelligence,” Mr. Bennett said Sunday

Once the alarm was raised, Israeli forces launched an extensive manhunt for the escapees, setting up checkpoints, and using aircraft to hunt them down.

The first two were found near the majority-Arab city of Nazareth five days after their escape. A specialist tracking team then found food and other items that could be bought in a prison canteen and followed the trail to an Arab village where Mr. Zubeidi was captured along with another fugitive, who was found sleeping in a truck, Mr. Dublin said.

Security officials and politicians lauded the help they received from local Arab Israelis who refused to help the fugitives and told police of their whereabouts.

Security officials said they ultimately brought the last two fugitives back into custody by lulling them and their Palestinian supporters into a false sense of security. The ruse revolved around tricking the escapees into thinking they had lost their trail.

Throughout the operation, Israeli forces said they believed that the fugitives would try reaching a refugee camp in Jenin, where well-armed Palestinian militants hold sway and could put up a fight.

Instead, officials continued to say in television news reports that they believed that at least one of the prisoners was still in Israel whereas they already knew that the last two prisoners had been in Jenin for several days, Mr. Dublin said.

The other part of the hoax was to send a decoy detachment of Israeli forces into Jenin, near the refugee camp, to distract the Palestinian forces, while a SWAT team encircled the fugitives’ hideout.

“It all went according to plan,” Mr. Dublin said.

One of the Palestinian fugitives, Iham Kamanji, then called his father to say he was giving himself up so that nobody else would be hurt in the building where they were hiding. “I thought he would call me from Lebanon or Gaza, a safe place,” his father said in a video distributed by the Palestinian Authority’s official news channel.

Israel’s armed forces said they arrested two other Palestinians who they accused of assisting the fugitives and who were with them in the hideout. Sporadic clashes with Palestinians also broke out in Jenin as Israeli forces withdrew with the prisoners.

The six prisoners will likely continue to be a sticking point in Israeli-Palestinian relations, however. Both the Palestinian Authority, which runs the West Bank, and Hamas, the militant group that governs Gaza, have made prisoner exchanges a pivotal issue.

Hazem Qassem, a spokesman for Hamas, said the six recaptured fugitives would be “at the head” of negotiations with Israel over prisoner swaps.

“Though they were rearrested…this operation will remain as lasting proof of the fragility of the Zionist security system and its ineptitude before the will of the Palestinian fighter,” Mr. Qassem tweeted Sunday.