The 120-member Knesset voted late yesterday 35 to 15 in favour of the bill, which was initiated by a far-right politician and approved by the cabinet in June, a parliament spokesman told AFP.
The law gives judges the power to convict murderers under a new category of "extraordinarily severe circumstances" which would prevent the government from releasing them in any future deals.
Israel freed 78 Palestinian prisoners during failed US-backed peace talks between July 2013 and April, including many who had been convicted for murdering Israeli civilians.
The releases angered hardliners such as Ayelet Shaked of the far-right Jewish Home party who initiated the new law earlier this year.
"The mass release of terrorists through diplomatic deals makes a mockery of the Israeli public as does shortening the prison terms of criminal murderers," she said in a statement in June.
But left-leaning politicians have said the law would tie Israel's hands in future talks, with Zehava Gal-On of the Meretz party accusing Prime Minister Benjamin Netanyahu of "capitulating to the extreme right and supporting a demagogic law.