Hopes of dialogue between Bahrain's Sunni leaders and the country's restive Shia majority have been dashed when 21 civilian activists were given lengthy prison sentences as a crackdown against protesters continues unabated.

The verdicts, handed down by a military court, were roundly criticised by human rights groups as clear examples of "political and summary justice".

The sentences were imposed under hardline emergency laws that targeted activists involved in demonstrations in February and March as fervour from the north African popular uprisings swept into the gulf kingdom. Seven of the accused were sentenced in absentia. They are thought to be in Britain.

Eight of those on trial were given life terms, while another eight received sentences of 15 years. They have 15 days to appeal. The defendants punched their air with their fists and shouted "peacefully" as their sentences were handed down, according to relatives.

Bahrain's rulers had accused the group of plotting to overthrow them and, in some cases, of having links to foreign states – a direct reference to Iran.

"Most defendants hauled before Bahrain's special military court are facing blatantly political charges, and trials are unfair," said Joe Stork, deputy Middle East director at Human Rights Watch.

The verdicts marked the culmination of three months of fierce crackdowns against demonstrators, who had taken to the streets of the tiny state to demand more access to positions inside the Sunni-dominated establishment.

Among those sentenced were prominent members of Bahrain's human rights community, including Abdulhadi al-Khawaja, Hasan Mushaima and Abduljalil al-Singace, as well as several clerics and members of the country's opposition political groups. The one Sunni member of the group, Ibrahim Sharif, was given a five-year sentence. His wife, Farida Ghulam, said that he called out "our people demand freedom" in the courtroom.

Khawaja then shouted: "We will continue our struggle," according to Ghulam. His daughter, Zainab, was forcibly removed from court by female guards after she cried out "Allahu akbar" or "God is great".

The Foreign Office criticised the sentences. Alistair Burt, a Foreign Office minister, said: "I am extremely concerned by the process surrounding today's sentencing of 21 opposition members and the nature of many of the charges. One of those found guilty is Ibrahim Sharif, a prominent moderate politician who has been a constructive participant in Bahraini politics and represents a registered political party. He was sentenced to five years.

"It is deeply worrying that civilians are being tried before tribunals chaired by a military judge, with reports of abuse in detention, lack of access to legal counsel and coerced confessions. The Bahraini government has committed to a national dialogue on 1 July, which must be supported with concrete actions to address the long-term challenges facing Bahrain. We will also expect any appeals process to thoroughly and transparently address the substantial concerns that have been raised in these tribunals."

From their earliest days, the protests were cast by the government as Iranian-backed plots. The verdicts were reached using anti-terror laws used under martial law, which gave the accused limited access to lawyers and offered little public scrutiny.

"Civilians should not have been tried in a military court, and these trials have been patently unfair," said Amnesty International's Middle East and North Africa programme director, Malcolm Smart. "In particular, the court failed to adequately investigate allegations that some of the defendants were tortured and made to sign false confessions, which seem to have been used as evidence against them.

"It is hard to see how there can be any meaningful political dialogue in Bahrain while the government remains so intent on locking up its critics. Bahrain's authorities must end these unfair military trials and release all prisoners of conscience immediately and unconditionally."

Security sweeps have detained several hundred people, human rights groups report, including doctors and nurses from two hospitals in Manama. Meanwhile hundreds more public and private sector workers have been suspended for taking part in protests.

Frequent clashes between security forces and activists have been calmed over the past months by several calls for dialogue – the latest in early June when a three-month period of martial law was lifted by the kingdom amid pledges of an imminent return to normality.

Military courts cannot hear new cases, but the government has said it will continue to deal with prosecutions begun while emergency laws were in effect.

Despite the verdicts, Bahrain's foreign minister, Khalid al-Khalifa, insisted that a national dialogue was still scheduled to start on 1 July. "All are encouraged to participate in shaping the future of our country," he said on Twitter. The statement raised speculation that an amnesty may be offered before then by King Hamad bin Isa al-Khalifa, who has been pressured by Saudi Arabia and the gulf states to deny the protests any momentum.

Saudi Arabia and members of the Gulf Cooperation Council, including Qatar and the UAE, have sent members of their military to Bahrain to help enforce the crackdown. Key hospitals that had been used by protesters as hubs had been blockaded by troops for several months and medics whom the government trusted have been brought in to run them.

The demonstrations and the crackdown that followed has taken a huge toll on Bahrain's economy. The Formula One Grand Prix will not be held this year amid the bad publicity for Bahrain. And the kingdom's reputation as a safe haven for banking has suffered, with reports that some financial institutions are considering relocating.

Authorities say around 24 people, most of them demonstrators, have been killed during the crackdown. Four have been sentenced to death for the killing of two policemen.