A young man, his face masked by a red cloth so that only his eyes are visible, strides at the head of a crowd of protesters down the street in the Shia village of Nuwaidrat in Bahrain.

The people behind him look as if they expect a confrontation with the police. Some wave red-and-white Bahraini flags, which have become the symbol of the pro-democracy protesters. "Soon the police will start shooting," warns an onlooker as two police vehicles screech to a halt at the entrance to the village. Soon afterwards we hear the thump of tear-gas canisters being fired.

Signs of revolt simmering just beneath the surface are everywhere in the island kingdom of Bahrain, five months after protesters first demanded reform. Inspired by the Arab awakening, thousands of demonstrators took over Pearl Square in the centre of Manama, the capital.

A month later, on 15 March, government security forces, backed by a military contingent from Saudi Arabia, drove out the protesters, bulldozed the square and launched a pogrom of extraordinary ferocity against the majority Shia community, which had supported the protests.

Bahrainis, both Shia and Sunni, are still traumatised. "I was expecting the government to thank us for treating so many people during the crisis," recalls one doctor of previously moderate political views, who instead found himself subjected to beatings and sleep deprivation.

A 64-year-old man, active in defence of human rights, named Mohammed Hassan Jawad, who is still in jail, gave details to his family about how interrogators had tortured him with electric shocks to his genitals, legs, ears and hands. They made him bow down before a picture of the Bahraini King, Hamad bin Isa al-Khalifa, and told him to open his mouth so they could spit in it, adding that "unless you swallow the spit we will urinate in your mouth instead". His family, allowed to see him for only brief supervised periods, noticed that his toe nails were dead and black from the electric shocks.

Bahrain, with a population of 1.2 million, half of them Arabs, should have been the one place in the Arab world where compromise was possible between rulers and ruled, and between Sunni and Shia. Instead it has joined places like Beirut and Jerusalem, with communities polarised and hate and suspicion filling the air. The shock of what happened is all the greater because Bahrain regards itself as one of the most liberal and best-educated countries in the Gulf. Unlike nearby Saudi Arabia, women drive cars and hold important government jobs.

The simple explanation for the human disaster that is consuming Bahraini society is that the government over-reacted. The Khalifas felt their rule was under threat as long-established despots across the Arab world were overthrown. They treated moderate reformers as if they were professional revolutionaries. Without any evidence, the authorities demonised Iran as the hidden hand behind the demand by the Shia for an end to discrimination. "The Sunni community here was told that it faced an existential threat and equal citizenship for Shia meant an end to the Sunni," one Shia political activist says. They believed it.

Bahrain has always been divided between the Sunni ruling élite, centred on the Khalifa royal family, and the Shia, but since March this has turned into something closer to an anti-Shia pogrom. Evidence of official sectarianism is widespread. After watching the beginning of a riot in Nuwaidrat we drove to a quieter part of the village where 10 Shia mosques had been destroyed three months earlier. A local man, who is writing a history of Shia mosques and holy sites in the neighbourhood and does not want his name published, points to a heap of rubble saying "this used to be the Momin mosque where 200 to 300 people worshipped. There has been a mosque here for 400 years".

He describes how, on 19 April, military and police had surrounded the area and moved in with construction equipment. By the time they withdrew, 10 out of 17 Shia mosques in Nuwaidrat had been levelled. Mosques were not alone in being targeted. Shia revere the burial places of their holy men, but in two places in Nuwaidrat the graves had been dug up by soldiers or police. The local historian points to a hole in the ground, saying this was the site of the grave of a Shia holy man called Mohammed Abu Kharis, who died 200 years ago. "They dug up his bones and threw them away," he said.

The official explanation of the destruction of at least 35 Shia mosques and religious sites is that they had been built without permission. It seems unlikely that the government could suddenly have been possessed by an overwhelming desire to use the army and police to enforce building regulations. Many Shia suspect that the Saudis were behind the destruction, since this is in the tradition of Wahhabism, the fundamentalist version of Sunni Islam prevalent in Saudi Arabia. One Shia leader has a different explanation, believing that the purpose of government-backed sectarianism is to intimidate the Shia community.

Official policy may not be so carefully calculated. Lubna Selaibeekh, spokesperson for the Ministry of Education, says she is "appalled" by claims that students were being denied scholarship funding because they are Shia or had taken part in protests. She says that students in UK who lost state funding because they joined demonstrations had got it back again. "There was an announcement but it was suspended."

She agrees that 6,500 out of 12,000 teachers in Bahrain took part in a strike to support the demonstrators at Pearl Square, but says only those who broke civil-service rules would face punishment. She asserts that the ministry had "no statistics on who is a Shia or who is a Sunni". The government may claim not to keep sectarian statistics, but its opponents certainly do.

Nabeel Rajab, head of the Bahrain Centre for Human Rights, has precise figures about discrimination showing that "in 2003, 18 per cent of top jobs in Bahrain were held by Shia; today [it] is 8 to 9 per cent". He believes the government is seeking to change the demography of the island by sacking Shia and bringing in and naturalising Sunni from Pakistan, Jordan, Yemen and other Sunni-majority countries. He says the "government is creating the ingredients for a civil war" because the more the Shia are marginalised, the angrier and more extreme they will become as "they have nothing to lose".

Some 2,500 Shia have been sacked, though King Hamad has promised they will get their jobs back. It may no be that easy. Hussain, an IT specialist in the partially state-owned Batelco telecommunications company, was one of those who lost their jobs. He says that there is now a layer of Sunni officials who do not want Shia to return. "They are treating us like Red Indians in America," he says. "We are the majority now but maybe not for long. I'm looking for a job in Qatar or Dubai."

King Hamad claims to have offered compromise and national dialogue, but this still hovers uneasily between real concessions and PR. The "national dialogue" forum that has just ended was heavily promoted by the government but turned out to be an unrepresentative talking shop. "The dialogue was a monologue," says Abdul Jalil Khalil Ibrahim, a negotiator for the main Shia party al-Wifaq, which withdrew from the dialogue. He says his party won a majority of all votes in the last election for the largely powerless Council of Representatives, but had just five members out of 320 attending the national dialogue.

Much more serious is the investigative commission into what has happened in Bahrain since February, headed by the human-rights lawyer Cherif Bassiouni, which has just started work in Bahrain. He sounds bemused by the degree of loathing with which the two different Bahraini communities regard each other. "The two have totally different narratives of what happened," he says. "This reflects a polarised society."

Mr Bassiouni is optimistic that the King and the Crown Prince want him to work as if he were leading a truth commission, apportioning blame between government and protesters. What happened in Bahrain persuades him of a darker truth. "When you scratch the surface, the worst of human kind appears," he says.

Bahrain: timeline of unrest

14 February Dubbed the "Day of Rage", anti-government rallies attract thousands of protesters. One is killed.

15 February Police fire on crowds at protester's funeral.

15 March Martial law is declared one day after Saudi troops enter Bahrain in an attempt to end the unrest.

18 March Pearl roundabout, geographical focal point of the mainly Shia protests, is bulldozed, killing seven.

6 June 47 medics who treated injured demonstrators go on trial accused of treason. They are allegedly tortured into signing false confessions.

10 June Bahrain Grand Prix is cancelled due to pressure from F1 teams.

11 June Up to 10,000 people attend a protest rally for political reform.

12 June Ayat al-Qurmezi is jailed for publicly reciting poetry criticising the king. She is released a month later, but claims she was tortured in custody.

22 June 10 Shia activists are sentenced to life in prison for plotting a coup.

2 July Talks between Sunni rulers and opposition groups begin.

1 August The European Tour drops Bahrain from its 2012 golf schedule.

Belfast Telegraph