DUBAI/CAIRO (Reuters) - Bahrain executed on Saturday three men convicted in two separate cases, one involving the killing of a police officer and the other the killing of a mosque imam, the public prosecutor said in a statement.

A man is seen on the roof of Bahrain's Embassy in London, Britain, July 26, 2019 in this still picture obtained from social media video by Reuters on July 27, 2019. Twitter/Sayed Ahmed AlWadaei/via REUTERS

Rights groups identified two of the men as Shi’ite activists Ali al-Arab and Ahmed al-Malali, who were sentenced to death last year in a mass trial along with another 56 men convicted and given jail terms on “terrorism crimes”.

The court jailed 19 for life and 37 for terms of up to 15 years, alleging they were part of a terrorist cell trained to use heavy weapons and explosives.

The prosecutor’s statement, which did not identify any of the men, said two of them were convicted for crimes including using an assault rifle to kill a police officer in 2017, in attacks orchestrated by what it called Iran-based ringleaders.

The third executed man was convicted of killing an imam in 2018.

Bahrain accuses mainly Shi’ite Iran of stoking militancy in the kingdom, which Tehran denies. Bahrain, a strategic island where the U.S. Navy’s Fifth Fleet is based, has a Shi’ite Muslim majority population but is ruled by a Sunni royal family.

Iran condemned the executions, state new agency IRNA reported.

“The Bahraini government’s sectarian act shows that, instead of choosing the path of rationality and trying to resolve a self-made crisis by reconciling with its people, it insists on its false policy of suppressing protesters,” IRNA quoted Foreign Ministry spokesman Abbas Mousavi as saying.

International rights groups including Amnesty International, Human Rights Watch and a U.N. human rights expert had urged Bahrain on Friday not to execute the two activists, on the grounds their confessions were obtained through torture.

“While in custody the men were tortured by security officers including through electric shocks and beatings. Ali Mohamed al-Arab’s toenails were also ripped out,” Amnesty International said in a statement.

The authorities have denied the accusations and say they are protecting national security from terrorists.

Mass trials became commonplace in Bahrain following a failed uprising in 2011 that was led by members of the Shi’ite opposition. Scores of people have been imprisoned, including politicians and rights activists, and many have fled abroad.

A London-based Bahraini activist rights group, the Bahrain Institute for Rights and Democracy (BIRD), said “the executions mark one of Bahrain’s darkest days”.

U.K. minister of state for human rights Tariq Ahmad said: “We express deep concern and regret that these executions were carried out...We will continue to engage with Bahrain on this issue bilaterally and at the UN Human Rights Council.”

In London, a protester was arrested for trespassing on a diplomatic premises late on Friday after climbing on to the roof of Bahrain’s embassy, British police said.

A video posted on YouTube showed the man unfurling a banner calling on new British Prime Minister Boris Johnson to intervene to stop the executions. It also showed emergency service officials breaking open the door of the embassy to gain access.