DUBAI (Reuters) - A Bahrain court sentenced 17 men to jail terms ranging from several years to life imprisonment on charges of forming a terrorist cell, the public prosecutor said on Thursday, days after a police raid killed five demonstrators.

Both the court ruling and Tuesday’s police operation targeting a village outside the capital Manama signal a strong line by the Sunni Muslim-ruled kingdom against the mostly Shi’ite opposition amid increased sectarian tensions.

The opposition says it is seeking more rights and better representation for Bahrain’s majority Shi’ite population, but the authorities accuse it of seeking to overthrow the government by force with the help of the kingdom’s arch-foe Iran.

“The 17 men (were) accused of the felony of establishing a terrorist group, joining that group, attempted murder of a public official and training on the use of weapons and explosives,” the prosecutor said in a statement.

Five were sentenced to life imprisonment, three of them to 10 years in jail and the rest to shorter terms. Eight of the men had their citizenship revoked. No further details were available.

Mounting gun and bomb attacks against Bahraini security forces, along with shootings of suspected militants, have ramped up tensions this year in the island kingdom.

Tuesday’s police raid in Diraz village led to the arrest of 286 people and was the deadliest day of violence in the Western-allied kingdom since the “Arab Spring” protests of 2011.

Forces entered the home of Shi’ite spiritual leader Isa Qassim aiming to round up suspects wanted in security cases, the interior ministry said, but activists say the raid targeted Shi’ite Muslims and used excessive force.

The raid and the court verdict come days after President Donald Trump said U.S. ties with Bahrain -- long strained over its human rights record -- would improve.