The suspected mastermind behind a deadly West Bank terror attack last month was among 1,027 Palestinian inmates freed by Israel in exchange for the release from Gaza of the captured Israel Defense Forces soldier Gilad Shalit in 2011.

On Sunday, the Shin Bet announced it had detained four members of a seven-member Hamas cell who allegedly opened fire on a car near the settlement of Shvut Rachel in June, killing Malachy Rosenfeld, 25, and wounding three others.

Rosenfeld was the sixth Israeli to be killed in attacks carried out or planned by Palestinians released under the Shalit deal since April 2014.

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

One of the alleged cell members, Ahmad Najjar, a Hamas operative who was said to have orchestrated and funded the shooting attack from Jordan, has yet to be apprehended, the security service said. Before being released in the Shalit prisoner exchange, Najjar spent eight years in an Israeli prison for his involvement in previous terror attacks that killed three Israelis.

Hamas’s terror network in the West Bank is largely operated by former security prisoners based in Gaza, Israeli media reported Monday.

Under the terms of the 2011 swap, the majority of prisoners hailing from the West Bank were deported to Gaza, where they have been able to leverage their connections in the West Bank to facilitate attacks.

Prisoners released to the West Bank have also engaged in violent activity against Israelis, and the Palestinian Authority and Israeli security forces have rearrested dozens of them for rioting, hurling Molotov cocktails and funding terrorism.

Najjar’s arrest is a reminder of the cost Israel has paid for Shalit’s freedom, a scenario that critics of the deal predicted would unfold. Since 2014, six Israelis have been killed in terror attacks by Palestinian prisoners released under the Shalit prisoner exchange.

In April 2014, a few hours before the Passover Seder, Baruch Mizrachi was shot dead in a roadside attack near Hebron. The 48-year-old Israel Police superintendent was killed by Ziad Awwad, a Hamas operative released in the prisoner swap.

Mahmoud Kawasame, one of Hamas operatives who abducted and killed the Israeli teenagers Naftali Fraenkel, Gil-ad Shaar, and Eyal Yifrach in June 2014, in a shocking attack that was among the triggers of the war in Gaza a month later, had also been released by Israel. Kawasame was originally imprisoned for his involvement in a 2004 suicide bus bombing in Beersheba that killed 16 Israelis. He was eventually shot dead by IDF soldiers.

Osama As’ad, a 29-year-old arms dealer from the West Bank refugee camp of Qalandia, who was imprisoned by Israel for selling weapons used in attacks and released under the Shalit deal, was recently rearrested for the lethal West Bank shooting of Danny Gonen in June.

Earlier this month, Prime Minister Benjamin Netanyahu shelved legislation that sought to institute the death penalty for convicted terrorists, in part in an effort to prevent future prisoner swaps.