5.  The applicant was born in 1969 and lives in Odessa. 6.  On 27 April 2002, in the course of a police operation, an undercover police officer bought a substantial quantity of cannabis from the applicant. The applicant was immediately arrested in accordance with Article 263 of the Administrative Offences Code for a violation of the drug circulation rules which constituted an administrative offence laid down in Article 44 of that Code. Following a body search and a search of the applicant’s car, the police found further quantities of the drug. 7.  On 29 April 2002 the local police office instituted criminal proceedings against the applicant for drug trafficking. 8.  On 2 May 2002 the Ovidiopolskyy District Court of Odessa (hereinafter “the District Court”) considered a request by the investigator for the applicant to be placed in pre-trial detention and rejected it. However, it extended the period of the applicant’s arrest up to a total of ten days, ordering the investigative authorities to obtain more information on the identity of the applicant and establish further circumstances justifying his detention pending trial. 9.  On 8 May 2002 the District Court ordered the applicant’s pre-trial detention on the ground that the applicant was charged with a serious crime and, if at large, would continue his criminal activity and abscond from the investigation and trial. 10.  On 25 June 2002 the District Court extended the period of the applicant’s pre-trial detention until 29 July 2002 as the investigative authorities needed more time to complete the case file, namely, to complete the biological expert examination, to order and carry out a narcotics forensic examination, to question Mr. Sh., who was the witness in the case, to familiarise the applicant with the case file, and to draw up the bill of indictment. The District Court also found that, given the character of the applicant and the gravity of the crime that had been committed, the preventive measure should be left unchanged. 11.  On 29 July 2002 the applicant was provided with access to the criminal case file to prepare his defence. 12.  On 6 August 2002 the applicant lodged a complaint against the investigation authorities with the District Court, claiming that there had been no legal basis for his detention, in so far as the period of his detention, fixed in the District Court’s decision of 25 June 2002, had expired on 29 July 2002 and had not been extended. This complaint was joined to the criminal case file. 13.  On 17 September 2002 the applicant finished studying the case file. 14.  On 18 September 2002 the supervising prosecutor approved the bill of indictment and the case file was referred to the District Court for adjudication. 15.  On 2 January 2003 the District Court considered the applicant’s complaint of 6 August 2002 in the course of the preliminary hearing and found that the applicant’s detention after 29 July 2002 had been lawful. In particular, the District Court established that during the period between 29 July and 17 September 2002 the applicant had been studying the case file and, in accordance with Article 156 of the Code of Criminal Procedure, this period was not taken into account in calculating the overall period of his detention pending trial. It further noted that on 18 September 2002 the case file had been referred to the District Court and therefore the applicant’s complaint was unsubstantiated. The District Court did not specify the reasons or legal basis for the applicant’s detention after the case had been referred to the court. At the same hearing the District Court considered that there had been no grounds for changing the preventive measure in respect of the applicant, but did not state this conclusion in the operative part of the decision. The preliminary hearing was held in the presence of the prosecutor; the applicant and his lawyer were absent. 16.  According to the Government, on several occasions in the course of the trial, namely 15 July 2003, 22 October 2003, 22 January 2004, 4 February 2004, and 27 April 2004, the District Court considered the applicant’s requests for release and rejected all of them because he was charged with a serious crime and might abscond from the investigation and trial if at liberty. 17.  On 12 May 2004 the District Court found the applicant guilty of drug trafficking and sentenced him to six years’ imprisonment, having included in the sentence the period of the applicant’s detention from 27 April 2002. 18.  On the same day the District Court issued a separate ruling to the effect that the applicant’s arrest on 27 April 2002 conducted under the Administrative Offences Code had not been lawful since Article 44 of that Code, relied on by the police officers, did not cover drug trafficking and was therefore evidently inapplicable to the applicant, who had been arrested when selling the drug to the undercover agent. The District Court notified the Odessa Regional Police Department of the established violation of the procedural law committed by the police officers and ordered that an internal inquiry into the circumstances of the applicant’s arrest be carried out.