5.  The applicant was born in 1979 and lives in Warsaw.
6.  On 11 February 2004 the applicant was charged with domestic violence.
7.  On 27 February 2004 a bill of indictment in respect of the applicant was lodged with the Warsaw District Court. Subsequently, on an unknown date the case was returned to the prosecution authorities in order to amend the charges.
8.  On 20 August 2004 the Warsaw District Court ordered the applicant to undergo a psychiatric assessment in a psychiatric hospital. The applicant did not lodge an interlocutory appeal against this decision.
9.  On 11 April 2005 the applicant was brought by the police to the Warsaw Psychiatric Hospital in order to undergo the psychiatric assessment. However, he refused to stay and left the waiting room. On the same day he was ordered to come to the hospital on 18 April 2005, on pain of detention on remand. On 18 April 2005 the applicant came to the hospital. However, he refused to stay for the assessment, explaining that he had many urgent matters to attend to.
10.  On 7 June 2005 the Warsaw District Court ordered the applicant’s detention on remand in accordance with Articles 249 § 1 and 258 § 1 (1) and (2) of the Code of Criminal Procedure (“the CCP”) (see paragraphs 25 and 26 below). The court held that in view of the applicant’s parents’ and his sister’s  testimonies there was a reasonable suspicion that the applicant had committed the offences with which he was charged. In addition, there was a reasonable risk that the applicant would obstruct the proceedings or that he would go into hiding. The court noted that the applicant’s mother had admitted that he had stayed irregularly at his home address: he had been coming home late in the evening and leaving early in the morning. Furthermore, the applicant had failed to comply with the order of 20 August 2004 to undergo a six‑week psychiatric assessment (see paragraph 8 above). The court noted the applicant’s parents’ submissions that his mental condition was bad, he was not able to function independently and he was in need of urgent medical assistance. The court also attached importance to the fact that the applicant had previously behaved in a similar manner. He had been admitted to a psychiatric hospital on 23 October 2001, however the next day he had left the hospital on his own initiative. Consequently, in the court’s view the applicant’s submissions that he would comply with the order to undergo a psychiatric assessment were not convincing.
11.  An appeal lodged by the applicant was dismissed by the Warsaw Regional Court on 20 September 2005. The court mainly referred to the fact that the applicant had still to undergo a psychiatric assessment. It also noted the fact that the applicant stayed irregularly at his home address, therefore once released he might go into hiding.
12.  The applicant’s detention was subsequently prolonged on the following dates: 28 September 2005 (until 4 January 2006), 27 December 2005 (until 4 February 2006) and 1 February 2006 (until 4 March 2006). The court relied on the grounds previously given. The applicant unsuccessfully appealed against all those decisions.
13.  On 18 October 2005 the Warsaw District Court ordered that the applicant undergo a psychiatric assessment at the hospital wing of the Warsaw Detention Center. The applicant underwent this assessment between 21 November 2005 and 1 February 2006.
14.  On 3 February 2006 the amended bill of indictment was lodged with the Warsaw District Court. The applicant was charged with domestic violence and possession of 1.15 grams of marijuana.
15.  On 16 February 2006 the Warsaw District Court again extended the applicant’s detention (until 4 May 2006). The court stressed that there was a reasonable risk that the applicant would obstruct the proceedings and that he would go into hiding. This risk was particularly valid in view of the difficulties which the applicant had caused in the past by his repeated refusal to undergo a psychiatric assessment.
16.  During a hearing held on 23 March 2006 the applicant’s father and sister refused to testify. The applicant was released from detention on the same day. Subsequently, on 5 April 2006, the applicant’s mother also refused to testify.
17.  The Warsaw District Court held further hearings on 27 April, 7 July and 16 October 2006 and on 24 January and 12 March 2007.
18.  On 12 March 2007 the Warsaw District Court gave judgment, acquitting the applicant on charges of domestic violence and convicting him of possession of a small amount of marijuana. The court sentenced the applicant to five months’ imprisonment stayed for three years.
19.  Following an appeal by the applicant, the judgment was quashed (in its part concerning possession of drugs) by the Warsaw Regional Court on 9 August 2007. The proceedings were subsequently discontinued by the Warsaw District Court on 6 November 2007. The court found that the prohibited act committed by the applicant had not constituted an offence because of its insignificant social consequences (znikoma szkodliwość społeczna czynu).
20.  On 5 November 2008 the applicant instituted proceedings for compensation for unjustified detention under Article 552 of the CCP (see paragraph 27 below) before the Warsaw Regional Court. He stated that while the main reason for his detention on remand had been a six-week psychiatric assessment, he had been kept in detention for nearly one year. Moreover, the assessment had begun only five months after his arrest. He also stressed that there had been no risk that he would have attempted to obstruct the proceedings.
21.  His claim was dismissed by the Warsaw Regional Court on 18 March 2010. The court referred at the outset to the Supreme Court’s Resolution of 15 September 1999 (see paragraph 28 below). It further noted that in the present case there had been no breach of procedural provisions of the CCP since the detention on remand had been applied mainly in view of the applicant’s repeated refusal to comply with the courts’ orders. Consequently, the applicant’s detention on remand had been undoubtedly justified, even though eventually he had been acquitted.
22.  On 16 July 2010 the Warsaw Court of Appeal dismissed the applicant’s appeal. The court repeated the reasons given by the Regional Court. It stressed that the applicant had clearly obstructed the proceedings by refusing to undergo a psychiatric assessment. Furthermore, there had been a risk that he could have gone into hiding. Lastly, the court noted that as soon as the applicant’s parents and sister had refused to testify, the applicant had been released.
23.  On 31 May 2011 the applicant’s cassation appeal was dismissed as manifestly ill-founded by the Supreme Court.