7.  The applicant was born in 1995 and lives in Cracow. 8.  On 7 May 2012 the applicant was arrested on suspicion of having committed three armed robberies and one attempted armed robbery with the use of a machete on 4 May 2012. He was initially detained in a police establishment for children (policyjna izba dziecka) in Cracow. 9.  On 7 May 2012 the Cracow-Krowodrze District Court (Family and Juvenile Section) instituted inquiry (postępowanie wyjaśniające) with a view to determining whether the applicant had committed the offences at issue. 10.  On the same day the Cracow-Krowodrze District Court decided to place the applicant in a shelter for juveniles (schronisko dla nieletnich) for a period of three months. It found that, in view of the available evidence, there existed a reasonable suspicion that the applicant had committed three armed robberies and one attempted armed robbery and some other offences. The court also noted that the applicant was lacking in moral character and that the nature of the offences with which he had been charged militated in favour of placing him in a correctional facility (zakład poprawczy). It also noted that there was a risk that he might go into hiding or put pressure on witnesses. 11.  The applicant appealed. He argued, inter alia, that there had been no risk of fleeing or interfering with witnesses. He also objected to his placement in the shelter on the grounds that he had a history of mental difficulties and had been schooled in a specialised institution. 12.  On 10 July 2012 the Cracow Regional Court upheld the decision of the lower court. It had regard to the gravity of the offences which the applicant had allegedly committed and the fact that they could not be treated as an isolated incident. The court also noted that in the past a family court had handed down a warning and that on 29 May 2012 he had been put under the supervision of a court guardian. In view of those circumstances, it was considered likely that the applicant would be placed in a correctional facility. His placement in the shelter was further justified by the fact that he had threatened one of the victims of the robbery. Responding to the arguments related to the applicant’s mental health, the court noted that the placement in the shelter, in addition to the applicant’s isolation, placed him under educational supervision which could not be seen as incompatible with his well-being. 13.  On 27 July 2012 the Cracow‑Krowodrze District Court ordered that the applicant’s case should be examined in correctional proceedings (postępowanie poprawcze). 14.  On 9 August 2012 the applicant’s counsel requested the Cracow‑Krowodrze District Court to order the applicant’s immediate release. He submitted that the three-month period for which the measure was applied had expired on 7 August 2012 and that no decision on prolongation of the measure had been given. He argued that in accordance with section 27 §§ 4 and 5 of the Juvenile Act the decision on prolongation of the placement in a shelter for juveniles could be taken only by a court after summonses had been sent to the parties and counsel. The applicant’s counsel obtained information from the court’s registry that in practice such decisions were not given, and that it sufficed for the court to issue an order for the case to be examined in correctional proceedings. The applicant’s counsel objected to such a practice and considered it to be unlawful. 15.  On 9 August 2012 the Cracow-Krowodrze District Court dismissed the applicant’s request for release. It provided the following reasons:
“The juvenile Maksymilian Grabowski is accused of having committed criminal acts with the use of a dangerous object.
These circumstances exclude the possibility of altering the security measure in respect of the juvenile.
At present the state of health of the juvenile is normal.
In the absence of reasons justifying the quashing of the security measure in respect of the juvenile, it has been decided as above in accordance with sections 20 and 27 of the Juvenile Act”. 16.  On 9 August 2012 the applicant’s counsel wrote to the director of the Gacki Shelter for Juveniles urging him to release the applicant. 17.  By a letter of 16 August 2012 the Cracow-Krowodrze District Court informed the applicant’s counsel that after the court had ordered the examination of the case in the correctional proceedings on 27 July 2012, it did not prolong the applicant’s placement in the shelter for juveniles pursuant to section 27 § 3 of the Juvenile Act. 18.  The Cracow-Krowodrze District Court held hearings in the applicant’s case on 21 November 2012 and 9 January 2013. On the latter date the court delivered a judgment and held that the applicant had committed the offences which had been imputed to him. The court ordered the applicant’s placement in correctional facility but suspended the application of this measure for a two-year probationary period. It further ruled to place the applicant under the supervision of a court guardian during the probationary period. 19.  Having regard to the judgment, on 9 January 2013 the Cracow‑Krowodrze District Court quashed the applicant’s placement in a shelter for juveniles. The applicant was released on the same day. 20.  The judgment of 9 January 2013 was not appealed against and became final on 14 February 2013.