5.  The applicant was born in 1984 and lives in Toksovo. 6.  The facts of the case, as submitted by the parties, may be summarised as follows. 7.  On 2 October 2009 the applicant was arrested on suspicion of raping K., who was employed at the Vasileostrovskiy District Court in St Petersburg as an assistant to Judge N., and who also was the daughter of that court’s former president, Judge K., who carried on working as a judge at that time. 8.  On 4 October 2009 Judge R. of the Vasileostrovskiy District Court remanded the applicant in custody. He rejected a challenge for bias which the applicant’s lawyer raised in respect of the entire composition of the District Court because of a link between the alleged victim and the judges of that court. On 26 October 2009 the St Petersburg City Court upheld the detention order on appeal, rejecting a challenge by the applicant as unsubstantiated. 9.  On 30 November 2009 a deputy president of the City Court referred an application by an investigator for an extension order to the Oktyabrskiy District Court for consideration. The District Court granted the application on the following day. On 11 December 2009 the City Court upheld that decision on appeal. However, on 31 March 2010 the Supreme Court of Russia determined that the decision to refer the application to another district court had been invalid, because the City Court’s deputy president had decided on the change of venue of his own initiative without hearing what the defendant’s opinion on that issue was. 10.  On 30 December 2009 a further extension was granted by the President of the Vasileostrovskiy District Court, Judge Sh., who again rejected a challenge for bias by the applicant. On 26 January 2010 the City Court upheld the extension order on appeal. By a separate decision of the same date, it upheld the rejection of the challenge in respect of Judge Sh.:
“The available material indicates that the court considered the challenge for bias in accordance with the established procedure, and upon review of the parties’ arguments found no grounds for the challenge; the stated grounds fall outside of the scope of Article 61 of the Code of Criminal Procedure, as they do not indicate the presiding judge’s interest in any predetermined outcome of the case ...
In addition, when considering the challenge in respect of the presiding judge, the court had regard to the opinion of the prosecutor, who declared at the hearing on 30 December 2009 that there were no legal grounds for allowing the challenge ... in particular because the hearing did not touch upon the defendant’s guilt; it was not an examination of the merits of the case, but a hearing [on the remand matter].” 11.  On 27 January and 27 February 2010 extension orders were issued by judges of the Kalininskiy District Court, which had territorial jurisdiction over the area where the applicant was detained. Those orders were upheld on appeal on 25 March and 8 April 2010. 12.  On 11 March 2010 the case against the applicant was referred to the Vasileostrovskiy District Court for trial and allocated to its President, Judge Sh. On 23 March 2010 Judge Sh. allowed the applicant’s challenge for bias in respect of the entire composition of that court, holding as follows:
“It has been established that the injured party in the criminal proceedings [K.] works as an assistant to the Vasileostrovskiy District Court’s Judge [N.], and that her father [Judge K.] is a judge of the Vasileostrovskiy District Court. It follows that circumstances exist leading the defendant and his counsel to believe that [Judge Sh.] and all the judges of the Vasileostrovskiy District Court are, either directly or indirectly, interested in the outcome of the criminal case.
In order to ensure an impartial examination of the criminal case, the challenge ... must be allowed and the case referred to the President of the St Petersburg City Court for determination of the territorial jurisdiction.” 13.  Continuing the same decision, Judge Sh. extended the applicant’s detention until 12 May 2010. On the last day of the extended period the Presidium of the City Court, by way of supervisory review, quashed the decision of 23 March in part in relation to the detention matter, on the grounds that an extension could not have been granted by a judge who had recused himself. The Presidium extended the applicant’s detention until 12 August 2010. 14.  On 15 April 2010 a deputy president of the City Court determined that the trial would be held in the Petrogradskiy District Court. On 31 March 2011 the Petrogradskiy District Court found the applicant guilty of rape and sentenced him to five years and six months’ imprisonment.