Deal brokered by John Kerry enables peace talks between Israelis and Palestinians to begin as early as next week

The release of 104 long-term Palestinian prisoners was approved by the Israeli cabinet on Sunday after an emotional debate when Binyamin Netanyahu, the Israeli prime minister, stressed the need to take tough and painful decisions in order to move towards renewed peace negotiations.

The prisoners' release is part of a deal brokered by the United States to begin preliminary talks on a possible resolution of the Israeli-Palestinian conflict this week. Most of the men have been in jail for more than 20 years.

The Palestinians warned that without an agreement to free the prisoners, they would not participate in the meetings in Washington, set to begin on Tuesday. The Palestinian leadership was anxious to secure a tangible gain for returning to the negotiations process amid deep public scepticism.

The vote, at the end of a cabinet meeting, whose start was delayed for more than an hour as Netanyahu engaged in frantic last-minute lobbying of ministerial colleagues, was 13 in favour, seven against and two abstentions.

The first of four groups of prisoners is expected to be released shortly before Eid al-Fitr, the Muslim holiday that marks the end of the holy month of Ramadan next week The rest will be freed at staged intervals over the next nine months, assuming progress is made in negotiations..

Netanyahu told the cabinet: "This moment is not easy for me. It is not easy for the ministers. It is not easy especially for the families, the bereaved families, whose heart I understand. But there are moments in which tough decisions must be made for the good of the country and this is one of those moments."

On Saturday he issued an "open letter to the citizens of Israel", which spoke of a painful decision but said "prime ministers from time to time make decisions that go against public opinion, when it is important for the country to do so."

Netanyahu faced stiff opposition to the move. Naftali Bennett, a key coalition partner and the leader of the rightwing Jewish Home party, said on Saturday: "Terrorists must be killed, not released. In every one of my previous positions, I fought against releasing terrorists, and I have no intention of acting any differently when I'm in the cabinet. Let my hand be cut off should I vote in favour of releasing terrorists. We support the peace process, but no country in the world would agree to release murderers as a gift."

Danny Danon, deputy defence minister and chairman of the central committee of Likud, Netanyahu's party, said he opposed "a crazy release of dozens of terrorists with the blood of hundreds of Israelis on their hands. All the more so, since the release would represent a reward to the Palestinians, just for agreeing to sit with us around the negotiating table."

The transport minister, Yisrael Katz,, who voted against the deal, said: "I am against releasing murderous terrorists. It hurts the bereaved families and encourages terror."

Some cabinet members said they were voting reluctantly in favour of the deal. "It is not a happy day, but we need to do what is right for Israel and for the peace process," said the finance minister, Yair Lapid, before the meeting.

The defence minister, Moshe Ya'alon, said he would vote for the measure with a heavy heart.

The prisoner issue is highly emotive among Palestinian families, many of whom have direct experience of the imprisonment of a close relative. The release of long-term prisoners – seen as national heroes – is likely to warm public attitudes towards renewed talks. However, hundreds of Palestinians marched in protest at the return to talks in Ramallah on Sunday.

Saeb Erekat, who will represent the Palestinians in this week's talks, welcomed the Israeli decision, but said it was "an overdue step" and that the Palestinian side would "continue working for the release of all our political prisoners".

He added: "We call upon Israel to seize the opportunity made by US secretary John Kerry towards the resumption of negotiations in order to put an end to decades of occupation and exile, and to start a new stage of justice, freedom and peace for Israel, Palestine and the rest of the region."

Netanyahu is thought to be acting under heavy pressure from the US secretary of state, John Kerry, who has invested four months of intensive diplomacy to get preliminary talks underway.

But the Palestinians also appear to have made a key concession. As well as the prisoner release, the Palestinians also wanted a written assurance from Kerry that the US supports the pre-1967 border as the basis for territorial negotiations, with any deviations being compensated with agreed land swaps.

However, Erekat appeared to be ready to depart for Washington without such an assurance. The Israelis have refused to sign up to either this or a publicly declared freeze on settlement construction.

Discussions between negotiators from both sides in Washington this week will be the first talks for almost three years. Many observers are sceptical about the prospects of an eventual peace deal, but Kerry's success at getting both sides together for initial discussions is seen as a triumph.

Elation over the prisoner deal on the Palestinian side will be matched with Israeli dismay and fury. More than 200 people demonstrated outside Sunday's cabinet meeting, many holding posters showing bloodied hands.

Miriam Peleg, 15, whose mother was slightly injured in a suicide bombing eight years ago in which two Israeli soldiers died, said it was "absurd to negotiate with people who want to kill us". Prisoners released in previous deals had gone on to commit further acts of violence, she said. "They won't stop, they'll kill more and more."

Israel Davis, 22, a soldier in a combat unit in the West Bank, said the release of prisoners would harm the Israeli state and "strengthen terror". Netanyahu, he said, was acting "only from American pressure. The next time innocent Israelis are killed it will be John Kerry's fault for boosting terrorism."

The Palestinian Prisoners' Society published a list of detainees expected to be released, along with their year of arrest and place of origin. Two have been in prison for 30 years.

The cabinet meeting also approved legislation to enable a referendum on any agreement reached in negotiations. The Palestinians have also pledged to put any deal to a referendum.