The issue of prisoners held on each side of the Arab-Israeli divide is an emotive and high-profile one.
Some individuals have become household names and the subject of intense campaigns, military and political, for their release.
Two years of delicate negotiations led to a major prisoner-exchange between Israel and the Lebanese Shia Islamist movement, Hezbollah, in July 2008.
But long-running efforts to broker a deal between Hamas and Israel, involving the release of several hundred Palestinian prisoners in exchange for the return of the captured Israeli soldier Gilad Shalit, have so far proven unsuccessful.
Since the first Palestinian uprising or intifada began in 1987, the vast majority of security prisoners held in Israel have been Palestinians.
According to Israeli, Palestinian and human rights groups' figures, there are somewhere between 7,000 and 8,500 Palestinians held for security reasons in Israel, including about 300 prisoners aged under 18.
The number is constantly changing. While the majority of the prisoners have been convicted and are serving sentences, there is a constant flow of Palestinians being detained into and released from "administrative detention" - under which they are held without trial.
In November 2009, there were at least 300 in administrative detention - the Palestinian Authority said there were as many as 800.
Israel says about 70% of its security prisoners have "blood on their hands", or are responsible for lethal attacks on Israelis.
These include senior figures from Palestinian militant groups and individuals held responsible for notorious suicide bombings in which dozens of Israelis died.
The Palestinians say 327 of the prisoners have been in jail since before the 1993 Oslo Agreement.
Palestinian officials also criticise the conditions inside Israeli prisons, describing them as "far below minimum standards"; Israel's prison authority says its security prisoners receive the "highest level" of treatment.
Some prisoners, such as the Fatah faction's Marwan Barghouti, play an important role in political life and wield considerable influence from their cells on rank and file members on the street.
The Israel Prisons Service is now in charge of the installations where almost all Palestinian prisoners are held.
Until 2006, the large detention centre at Ofer in the West Bank, as well as Megiddo Prison and Ketziot Prison in Israel, were under the control of the Israeli army.
Releases of Palestinian prisoners have in the past been included in peace negotiations.
They have also been used as goodwill gestures, sometimes seen as efforts to influence popular opinion - for example by boosting the popularity of Palestinian Prime Minister Mahmoud Abbas.
The Gaza Strip witnessed an intense wave of violence following the capture by Palestinian militants of Israeli Sgt Gilad Shalit, 21, on 25 June 2006. Sgt Shalit was seized in a raid on an Israeli army position at Karem Shalom, near the eastern edge of the Gaza Strip.
He was the first Israeli soldier captured by Palestinian militants since 1994. Hamas, which seized Sgt Shalit - then a corporal - in a joint operation with other groups, said it would consider releasing him as part of a prisoner exchange.
A proof of life video, in which he is seen holding a newspaper printed in the Gaza Strip, was received in October 2009.
Reservists Ehud Goldwasser and Eldad Regev were captured by Hezbollah near the Israel-Lebanon border on 12 July 2006, prompting immediate Israeli military action.
On 16 July 2008, Hezbollah handed over the human remains of both men in a swap for several high-profile Lebanese prisoners held in Israeli jails - including Samir Qantar.
The swap caused controversy in Israel, with some ministers opposed to the idea of exchanging live Hezbollah prisoners for dead bodies. But Israel's government said it had a moral obligation to bring its soldiers home.
A number of other Israeli soldiers went missing in action in the 1980s and 1990s, but it is not known if any remain alive. The best-known case is that of Ron Arad, an airman captured by Shia militiamen after his plane crashed in Lebanon in 1986 and subsequently believed to have been transferred to Iran.
On 1 June 2008, Israel released Nissim Nasser, an Israeli citizen of Lebanese descent, who in 2002 had been convicted of spying for Hezbollah.
Hezbollah responded to the release by handing over a box reportedly containing the remains of Israeli soldiers killed during the 2006 war.
The exchange sparked rumours of wider, two-year long prisoner swap negotiations being facilitated by German mediators.
These rumours were confirmed when Israel handed over five Lebanese prisoners and the bodies of 200 Lebanese and Palestinian fighters in return for the bodies of Goldwasser and Regev.
The swap was mediated by the International Committee of the Red Cross (ICRC).
Lebanon declared a national holiday to mark the swap, which Hezbollah claimed was a major victory. After a major prisoner swap in early 2004 - in which more than 400 prisoners were released to Hezbollah in exchange for a reservist colonel and the bodies of three Israeli soldiers - the July 2008 exchange left no Hezbollah militants in Israeli jails.
Chief among those released was Samir Qantar, who had been serving several life sentences for murder after attacking a civilian apartment block in Nahariya in 1979.
A policeman, another man and his four-year-old daughter were killed. A baby girl was accidentally smothered by her mother as she hid in a cupboard.
Hezbollah leader Sheikh Hassan Nasrallah had frequently called for Qantar's release, threatening to derail the 2004 deal when he was excluded from the list of prisoners.