5.  The applicant was born in 1990 and lives in Moscow. 6.  The background facts relating to the planning, conduct and dispersal of the demonstration at Bolotnaya Square are set out in more detail in Frumkin v. Russia (no. 74568/12, §§ 7-65, 5 January 2016), and Yaroslav Belousov v. Russia (nos. 2653/13 and 60980/14, §§ 7-33, 4 October 2016). The parties’ submissions on the circumstances directly relevant to the present case are set out below. 7.  On 6 May 2012 a public demonstration entitled the “March of Millions” was held in central Moscow to protest against the allegedly rigged presidential elections. The event had been approved by the city authorities in the form of a march followed by a meeting at Bolotnaya Square which was supposed to end at 7.30 p.m. The march was peaceful and held without any disruptions, but when the marchers arrived at Bolotnaya Square it became apparent that barriers installed by the police had narrowed the entrance to the meeting venue, allegedly restricting the space allocated for the meeting. To control the crowd the police cordon forced the protestors to remain within the barriers; there were numerous clashes between the two sides. At 5.30 p.m. the police ordered the meeting to finish early and began to disperse the participants. It took them about two hours to clear the square. 8.  On the same day the Moscow city department of the Investigative Committee of the Russian Federation opened criminal proceedings to investigate suspected acts of mass disorder and violence against the police (Articles 212 § 2 and 318 § 1 of the Criminal Code). On 18 May 2012 the file was transferred to the headquarters of the Investigative Committee for further investigation. On 28 May 2012 an investigation was also launched into the criminal offence of organising acts of mass disorder (Article 212 § 1 of the Criminal Code). The two criminal cases were joined on the same day. 9.  At the time of his arrest the applicant was working as an artist. According to him, on 6 May 2012 he arrived at Kaluzhskaya Square to take part in the march and walked down Yakimanka Street to Bolotnaya Square. He passed the metal detectors and joined other protestors in front of the stage, where a rock group was performing. Sometime after 6 p.m. he walked towards Malyy Kamenyy Bridge but discovered that movement in that direction had been blocked by a police cordon. The applicant walked back, staying in the general area; at around 7.30 p.m. groups of police officers started pushing into the crowd, forcing it apart by using their truncheons. Protestors were surrounded and squeezed together. At some point the applicant realised that he was facing the police line and that the police were using excessive force to arrest protestors. The applicant was both angered and scared by the actions of the police and actively resisted. He was eventually seized by four police officers and escorted to a police car, which took him to a police station. 10.  On 14 May 2012 the Justice of the Peace of the 100th Court Circuit of the Yakimanka District of Moscow found the applicant guilty of non‑compliance with a lawful order by a police officer, an offence under Article 19.3 of the Code of Administrative Offences. The Justice of the Peace established that after the meeting at Bolotnaya Square the applicant had shouted anti-government slogans, ignoring the lawful demands of the police to cease those acts. He had thrown objects at the police officers, including stones, flagpoles, empty plastic bottles, and pieces of asphalt, and had refused to proceed to the police van. The applicant was sentenced to detention of twenty-four hours. It appears that after his release the applicant continued to live at his usual address and pursue his customary activities. 11.  On 28 May 2012 the applicant’s flat was searched. On the same day he was detained on suspicion of participation in acts of mass disorder and of committing violent acts against the police on 6 May 2012. 12.  On 30 May 2012 the Basmannyy District Court of Moscow ordered that the applicant be placed in pre-trial detention until 6 July 2012. It referred to the gravity of the charges and stated that if he was at liberty the applicant could co-ordinate his position with accomplices whose identities were still being established by the investigation. The court also pointed out that the applicant had forcefully resisted the police officers during his arrest, which had led to them using force and handcuffs against him. In addition, the court relied on information obtained from undercover sources that the applicant had connections with football fans and groups of anarchists. The applicant denied that allegation and challenged the use of information from undisclosed sources. However, the court concluded that there were sufficient reasons to believe that he was likely to abscond, continue his criminal activity, threaten witnesses, destroy evidence or otherwise obstruct the course of the criminal proceedings. It dismissed a request from the applicant for an alternative preventive measure and found that his release was not required on health grounds. 13.  On 4 June 2012 the applicant lodged an appeal against the detention order, which was dismissed by the Moscow City Court on 27 June 2012. 14.  On 5 June 2012 charges were brought against the applicant under two Articles of the Criminal Code, Articles 212 § 2 (participation in acts of mass disorder accompanied by violence) and 318 § 1 (use of violence against a public official). He was accused, in particular, of active resistance to police officers and of participation in a group assault on a police officer whereby the applicant had allegedly pulled a protective helmet off the officer’s head and had punched and kicked him on the head and body. 15.  On 4 July 2012 the Basmannyy District Court examined an application from the investigator for an extension of the applicant’s pre-trial detention. The applicant argued that he had no criminal record, was in work, and had a permanent residence in Moscow where he lived with his family. He denied any involvement with football fans or anarchists and asked for the preventive measure to be changed to house arrest. On the same day the District Court granted the investigator’s application and extended the applicant’s detention until 6 November 2012. It relied on the gravity of the charges and information on the applicant’s character, which gave it sufficient grounds to presume that he might reoffend, threaten witnesses and other participants of the criminal proceedings, destroy evidence or otherwise obstruct the proper administration of justice. 16.  On 12 July 2012 the applicant lodged an appeal against the extension order, which was dismissed by the Moscow City Court on 6 August 2012. 17.  On 31 October 2012 the Basmannyy District Court examined a new application for an extension of the applicant’s pre-trial detention. Referring to the gravity of the charges and the complexity of the criminal investigation, the court extended his detention until 6 March 2013. 18.  On 13 November 2012 the applicant lodged an appeal against the extension order, which was dismissed on 3 December 2012 by the Moscow City Court. 19.  On 16 November 2012 the charges against the applicant were updated. The classification of the offences remained unchanged but it was specified that the applicant had struck the police officer once on the head and had kicked him once on the body while he was lying on the ground. 20.  On 1 March 2013 the Basmannyy District Court authorised a further extension of the applicant’s detention until 28 May 2013. The court relied on the gravity of the charges and the need to allow the defendants sufficient time to read the investigation case file. That decision was upheld by the Moscow City Court on 10 April 2013. 21.  On 23 April 2013 the Moscow City Court granted an extension of the applicant’s detention until 6 July 2013. The court noted that even though the applicant and his lawyer had already finished reading the case file, other defendants had not. It reiterated the grounds given in the previous extension orders and stated that the circumstances justifying the detention order had not changed. The Moscow City Court upheld that decision on 30 May 2013. 22.  On 24 May 2013 the applicant’s criminal case was transferred to the Zamoskvoretskiy District Court of Moscow for the determination of criminal charges. 23.  On 6 June 2013 that court granted another extension of the applicant’s detention, until 24 November 2013. The decision concerned eleven defendants. Along with the gravity of the charges, the court based its decision on the findings that “the reasons which initially warranted the detention have not changed” and that “no other measures of restraint would secure the aims and goals of the judicial proceedings”. The Moscow City Court upheld that extension order on 2 July 2013. 24.  On 19 November 2013 the Zamoskvoretskiy District Court granted another extension of detention in respect of nine defendants, including the applicant. It ordered their detention until 24 February 2014 on the grounds of the gravity of the charges and the nature of the offences imputable to them. On 17 December 2013 the Moscow City Court upheld that extension order. 25.  On 6 June 2013 court proceedings began in hearing room no. 338 at the Moscow City Court, moving at the end of July 2013 to hearing room no. 635. The defendants, including the applicant, were held in glass cabins in both hearing rooms. From mid-September 2013 to the end of 2013 the hearings continued at the Nikulinskiy District Court of Moscow in hearing room no. 303, while in January and February 2014 they took place at the Zamoskvoretskiy District Court in hearing room no. 410. Those hearing rooms were equipped with metal cages in which nine defendants (seven from 19 December 2013), including the applicant, sat during the hearings. 26.  For a detailed description of the conditions in those hearing rooms see Yaroslav Belousov (cited above, §§ 74-77). 27.  On 6 June 2013 the Zamoskvoretskiy District Court of Moscow began a preliminary hearing in a criminal case against ten participants in the demonstration at Bolotnaya Square, who were charged with participation in acts of mass disorder and committing acts of violence against police officers. On 18 June 2013 the court began the trial on the merits. 28.  On an unidentified date Police Officer K., the alleged victim of the applicant’s assault, was examined as a witness. He testified that he had been carrying out an order to split the crowd up when someone had pulled at his bullet-proof vest. He had fallen to the ground; someone had hit him several times and had taken off his anti-riot helmet. Other police officers had picked him up to take away him from the crowd. As a result of his fall and the blows, he had sustained injuries. Another police officer, V.K., testified that the applicant had kicked an unidentified police officer. 29.  Three other officers, also examined as witnesses, stated that the applicant had resisted arrest by planting his feet firmly on the ground and attempting to escape. He had also uttered obscenities to the police officers and shouted at them. 30.  On 21 February 2014 the Zamoskvoretsky District Court found the applicant guilty as charged. It held, in particular, as follows:
“Between 4 p.m. and 8 p.m. on 6 May 2012 ... at Bolotnaya Square ... unidentified persons ... called those present [at the venue] to move outside the agreed meeting venue, to defy the lawful orders of the police ..., to use violence ... which led to mass disorder accompanied by the use of violence against public officials in connection with the performance of their duties [and] the destruction of property.
On the same day at 5 p.m. at the latest [the defendants] acquired the criminal intent to participate in mass disorder and to use violence against ... police officers ...
Moreover ... the participants of the acts of mass disorder threw chunks of tarmac, stones, sticks and other objects at the police ... which hit them on various parts of their body, and [the defendants] ... [who] participated in the acts of mass disorder ... implemented their criminal intent to use violence against public officials ... applied physical force which was not a danger to the life or health of those [officials] ...
Thus, [the applicant] used violence against Police Officer [K.] which did not endanger his life or health ...
... between 5.10 p.m. and 8.20 p.m. ... unidentified participants of acts of mass disorder ... intentionally seized [K.] by his uniform and knocked him down, while [the applicant] together with other unidentified participants of acts of mass disorder, acting intentionally ... tore off [K.’s] anti-riot helmet ... and punched and kicked him several times on his head and body, meanwhile [the applicant] punched [K.’s] head at least once and at least once kicked [K.] on the body when the latter was lying on the ground. ...
[The applicant] ... pleaded not guilty and testified that ... he wanted to see why the meeting was not starting and went to Malyy Kamennyy Bridge where he saw the cordon ... Around 7.30 p.m. [the applicant] saw how police officers ... started beating people with truncheons. ... Then a jam occurred ... At some point [the applicant] found himself in the first line and saw the police officers harshly arresting and beating people, who tried to evade the blows. He was hit several times on the shoulder and the head, which led to dizziness. He was scared, he felt that his life was in danger, and while in a state of fury he moved towards a police officer, who happened to be [K.] and then moved his leg towards the police officer, who was getting up. [The applicant] did not see who knocked the latter down... [He] did not know whether his hand reached the target but supposed that he was able to touch the bullet-proof vest. He definitely did not touch [K.] with his leg and he caused him no harm. A few minutes later he was taken out of the crowd and beaten, his T-shirt was torn, then ... four police officers seized him and dragged him along the tarmac to the police vehicle. [The applicant] insists that he caused no injuries to the police officer and that his actions, provoked by panic, were taken in response to the events occurring around him. ...
... the court considers the [defendants’] arguments that they were protecting somebody from the police officers or happened to be victims of the police’s use of force as farfetched and aimed at the mitigation of their responsibility ...
... no medical document which could prove the presence of injuries on the [applicant’s] body ... was provided to the court.” 31.  The applicant was sentenced to three years and seven months’ imprisonment, calculated on the basis of a three-year prison term under Article 212 § 2 of the Criminal Code, partly concurrent with a term of one year and eight months under Article 318 § 1 of the Criminal Code. The applicant’s pre-trial detention counted towards the prison sentence. 32.  The applicant appealed against the judgment. He contested the classification of the crimes under both Article 212 and Article 318 of the Criminal Code. He insisted that he had been a victim of unlawful police action and that his involvement in using violence against the police officer has not been proven. 33.  On 20 June 2014 the Moscow City Court upheld the first-instance judgment.