Tunisia's parliament approved Thursday imposition of the death penalty for "terrorist" crimes, despite opposition from rights groups and a de facto quarter-century moratorium on executions.
Lawmakers were voting during the second of three days of debate on a bill aimed at beefing up powers to confront a jihadist threat following deadly attacks claimed by the Islamic State group.
President Beji Caid Essebsi imposed a state of emergency after a student went on a shooting rampage at a beach resort last month, killing 38 foreign tourists, most of them Britons.
That incident came on the heels of one in March in which two gunmen attacked Tunisia's national museum, killing 21 foreigners and a policeman.
Lawmakers voted heavily in favour of three articles imposing the death penalty.
Article 26 applies to anyone who "knowingly murders someone enjoying international protection," a reference to such people as diplomats and international civil servants.
The following article applies to cases in which people die in hostage-taking or kidnapping situations, while Article 28 refers to people who commit rape during the course of a terrorism-related crime.
Sana Mersni, an MP with the Islamist Ennahda party, noted ironically that the death penalty would not deter "terrorists seeking death in order to go to paradise".
The bill would replace the 2003 terrorism law, passed under the dictatorship of president Zine El Abidine Ben Ali, ousted four years ago, which was widely criticised as being a tool to crush dissent.
The death penalty already exists under Tunisian law, for such crimes as murder and rape, but no one has been hanged since 1991.
Rights groups had hoped parliament would leave it out of the current bill.
Among other things, the bill would make it easier for investigators to use phone-tapping against suspects and make public expressions of support for terrorism a jailable offence.
Advocacy groups, including Amnesty International and Human Rights Watch, have condemned the bill.
Describing it as draconian, they say its definition of terrorist crimes is too vague and that it fails to adequately safeguard the rights of defendants and could undermine freedoms.
"Tunisian authorities have legitimate concerns about the growing influence of extremist groups and individuals and the threat they pose to Tunisians and foreigners," Eric Goldstein, HRW's deputy Middle East and North Africa director, has said.
"But laws to counter terrorism should meet -- not flout -- international human rights standards," he said in a statement.
Critics say the bill would allow the authorities to detain suspects for 15 days without access to a lawyer or being brought before a judge, as well as put harsh restrictions on journalists.
Ammar Amroussia, of the leftist Popular Front, said "we fear the fight against terrorism could be turned into a fight against social and popular movements."
Labiadh Salem, an independent, was even more scathing.
"This law will not limit the phenomenon of terrorism; this law will fuel terrorism" as it "does not distinguish between social movements and protesters and terrorist acts".