4.  The applicant was born in 1964 and lives in Zawada, Poland. 5.  The applicant was arrested by the police on 24 June 1999. On the following day the Lubartów District Court (Sąd Rejonowy) ordered his detention on remand for a period of three months on suspicion of armed robbery. It took into account the nature of the offence and the strong likelihood that the applicant would be given a heavy sentence. In addition, it had regard to the fact that the applicant had been previously convicted of a violent crime. 6.  On 14 September 1999 the Lublin Regional Court (Sąd Okręgowy) prolonged the applicant’s detention until 23 December 1999, having regard to the strong suspicion that he had committed the offence in question. It also found that the applicant’s detention was justified, given the gravity of the charge and the severity of the likely sentence. The court further held that the investigation could not be concluded within the period of three months because the applicant had to undergo a psychiatric examination. 7.  The applicant underwent a psychiatric examination between 24 September and 1 October 1999. On 18 October 1999 a psychologist and two psychiatrists submitted their report. According to their findings, the applicant was able to understand his acts at the time of the commission of the alleged offence and could participate in the trial. 8.  On 29 October 1999 the applicant was additionally charged with theft. 9.  On 6 December 1999 the Lubartów District Prosecutor (Prokurator Rejonowy) terminated the investigation. On 8 December 1999 the prosecution filed a bill of indictment with the Regional Court. The applicant and his brother were charged with armed robbery and inflicting minor bodily harm. The applicant was additionally charged with theft. The bill of indictment specified that the applicant was subject to the rules on recidivism as in 1989 he had been convicted of assault with intent to rob and inflicting grievous bodily harm and had been sentenced to four years’ imprisonment. In addition, in 1994 the applicant had been convicted of manslaughter and sentenced to eight years’ imprisonment. 10.  On 21 December 1999 the Regional Court ordered that the applicant be kept in custody until 30 June 2000. It observed that the evidence obtained in the proceedings indicated that there was a strong likelihood that the offences in question had been committed by the applicant. It further considered that continuation of his detention was necessary in order to secure the proper conduct of the proceedings, given the nature of the offence and the severity of the likely sentence in respect of the charge of armed robbery. 11.  The applicant’s detention was subsequently prolonged by the Regional Court on 16 June 2000 (until 1 September 2000) and on 30 August 2000 (until 31 December 2000). The court relied on the same grounds as invoked in its earlier decision. 12.  The Regional Court held 7 hearings (6 April, 17 May, 16 June, 20 July, 14 September, 16 October and 16 November 2000). On 23 November 2000 it gave judgment. The applicant was convicted as charged and sentenced to 5 years’ imprisonment. The applicant and the prosecution appealed against the Regional Court’s judgment. 13.  On 28 December 2000 the Regional Court ordered that the applicant be kept in custody until 28 March 2001. On 14 March 2001 the Lublin Court of Appeal (Sąd Apelacyjny) prolonged his detention until 29 June 2001. 14. On 5 April 2001 the Lublin Court of Appeal quashed the first-instance judgment and ordered a retrial. 15.  It appears that in the course of the retrial the Regional Court ordered that the applicant be examined by a psychiatrist and psychologist. According to their report, at the relevant time the applicant was not suffering from diminished responsibility for his acts, although he was a mentally handicapped person with an unsound personality. 16.  The Lublin Regional Court several times prolonged the applicant’s detention. The relevant decisions were given on 12 June 2001 (prolonging his detention until 31 December 2001), on 11 December 2001 (ordering his continued detention until 30 April 2002), on 20 March 2002 (extending his detention until 20 June 2002), on 18 June 2002 (prolonging that period until 18 September 2002) and on 17 September 2002 (ordering his continued detention until 17 December 2002). In all those decisions, the Regional Court relied on the reasonable suspicion that the offences in question had been committed by the applicant, having regard to the evidence obtained in the proceedings. It further found that his continued detention was necessary in order to secure the proper conduct of the proceedings, given the nature of the charges and the severity of the sentence to which the applicant was liable. In the latter respect, the court found that the offence of armed robbery with which the applicant had been charged constituted a serious social danger and that the applicant was a recidivist offender. 17.  The applicant’s numerous requests for release and appeals against prolongation of his detention were to no avail. The courts, having regard to the relevant medical and court officers’ reports, did not find any reason which would justify the applicant’s release on the grounds specified in Article 259 § 1 of the Code of Criminal Procedure. 18.  The Regional Court held 7 hearings (8 October and 28 November 2001, and 24 January, 27 February, 20 March, 29 May and 2 October 2002). It gave judgment on 8 October 2002. The applicant was convicted of armed robbery and theft and sentenced to 7 years’ imprisonment. He appealed against that judgment. 19.  On 27 May 2003 the Lublin Court of Appeal gave judgment. It acquitted the applicant of theft and upheld the remainder of the Regional Court’s judgment. The applicant lodged a cassation appeal against the Court of Appeal’s judgment. On 21 July 2004 the Supreme Court (Sąd Najwyższy) dismissed his cassation appeal as being manifestly ill-founded.