Prosecutors in Bahrain have charged an 11-year-old boy with taking part in an illegal gathering, which could see him sent to jail.

Ali Hasan, a primary school pupil from the capital's suburban area of Bilad al-Qadeem, was picked up by security officials from his neighbourhood on accusations that he helped protesters block a street with rubbish containers and wood during anti-government demonstrations in the area last month. He subsequently spent nearly a month in a juvenile detention centre before being released last week to await trial.

Ali told the Guardian he was merely playing with friends in the street and had nothing to do with the protests.

"The verdict will be issued on 5 July," said Ali's lawyer, Shahzalan Khamees, who defended him at the juvenile criminal court in Manama on Wednesday. "They charged him with illegal gathering that has a few weeks up to three years imprisonment as punishment under the country's law." Ali was accompanied to court by his father, Jasem Hasan.

Khamees described Ali as a "political prisoner" and said: "Ali was scared in the court. He didn't want to go back to jail again, he hated his time in custody." She added: "It's a shame that the authorities in the country are putting its children in jail instead of protecting them.

"Young people in Bahrain are all watching Ali's case with much distress, they want to know what will happen to him, they don't want to experience the same fate."

Khamees said that Ali was not the only child to be arrested in connection with the 15 months of protest against the Khalifa dynasty, a Sunni minority ruling over Bahrain's Shia majority since its independence.

Bahraini officials said that the country's chief of public security, major general Tariq al-Hassan, had ordered an official investigation into Ali's arrest and had found that he "was arrested for blocking a crowded main road on three separate occasions in the course of one afternoon".

An official statement given to the Guardian by the Bahraini embassy in London said: "When he was arrested he told police that he had been paid 3 Bahrain dinars [£5] to commit the illegal acts."

It denied that Ali had attended a criminal court, saying "there are no trials in the juvenile court" and that "a judge makes a decision after hearing from the child, their lawyer, a social worker, and the prosecuting attorney".

The statement went on: "The judge's decision is based on what is best for the child. The notion of punishment does not enter the equation."

In a letter to the Guardian – provided through the embassy – in response to Ali's interview, Hassan said: "Being taken into police detention in these circumstances equates, in UK terms, to being taken to a place of safety. What Ali was doing was putting himself and others in danger."

In response to the widespread demonstrations in recent months, Bahraini rulers have launched a campaign of prosecution against human rights activists and even doctors and nurses accused of helping protesters.

Activists including Amnesty International have expressed concerns about Ali who they said has been tried on "spurious charges".

"This case shows the excessive means the Bahraini authorities have resorted to in order to crush protest. I hope they will see sense and drop all the charges against Ali Hasan," said Hassiba Hadj Sahraoui, Amnesty's deputy director for the Middle East and North Africa programme.