1 This request for a preliminary ruling concerns the interpretation of point (b) of the third subparagraph of Article 15(2) of Directive 2008/115/EC of the European Parliament and of the Council of 16 December 2008 on common standards and procedures in Member States for returning illegally staying third-country nationals (OJ 2008 L 348, p. 98), the second subparagraph of Article 9(3) of Directive 2013/33/EU of the European Parliament and of the Council of 26 June 2013 laying down standards for the reception of applicants for international protection (OJ 2013 L 180, p. 96) and Article 28(4) of Regulation (EU) No 604/2013 of the European Parliament and of the Council of 26 June 2013 establishing the criteria and mechanisms for determining the Member State responsible for examining an application for international protection lodged in one of the Member States by a third-country national or a stateless person (OJ 2013 L 180, p. 31; ‘the Dublin III Regulation’), read in the light of Articles 6 and 47 of the Charter of Fundamental Rights of the European Union (‘the Charter’).
2 The request was made in proceedings between C, a third-country national who is the subject of a return procedure, and the Staatssecretaris van Justitie en Veiligheid (State Secretary for Justice and Security, the Netherlands) (‘the State Secretary’) concerning the lawfulness of two consecutive detention measures imposed by that authority.
3 Recital 9 of Directive 2008/115 states: ‘In accordance with Council Directive 2005/85/EC of 1 December 2005 on minimum standards on procedures in Member States for granting and withdrawing refugee status [(OJ 2005 L 326, p. 13)], a third-country national who has applied for asylum in a Member State should not be regarded as staying illegally on the territory of that Member State until a negative decision on the application, or a decision ending his or her right of stay as asylum seeker has entered into force.’
4 Article 2(1) of that directive provides: ‘This Directive applies to third-country nationals staying illegally on the territory of a Member State.’
5 Article 15 of that directive provides: ‘1. Unless other sufficient but less coercive measures can be applied effectively in a specific case, Member States may only keep in detention a third-country national who is the subject of return procedures in order to prepare the return and/or carry out the removal process, in particular when: (a) there is a risk of absconding or (b) the third-country national concerned avoids or hampers the preparation of return or the removal process. Any detention shall be for as short a period as possible and only maintained as long as removal arrangements are in progress and executed with due diligence. 2. Detention shall be ordered by administrative or judicial authorities. Detention shall be ordered in writing with reasons being given in fact and in law. When detention has been ordered by administrative authorities, Member States shall: (a) either provide for a speedy judicial review of the lawfulness of detention to be decided on as speedily as possible from the beginning of detention; (b) or grant the third-country national concerned the right to take proceedings by means of which the lawfulness of detention shall be subject to a speedy judicial review to be decided on as speedily as possible after the launch of the relevant proceedings. In such a case Member States shall immediately inform the third-country national concerned about the possibility of taking such proceedings. The third-country national concerned shall be released immediately if the detention is not lawful. 3. In every case, detention shall be reviewed at reasonable intervals of time either on application by the third-country national concerned or ex officio. In the case of prolonged detention periods, reviews shall be subject to the supervision of a judicial authority. 4. When it appears that a reasonable prospect of removal no longer exists for legal or other considerations or the conditions laid down in paragraph 1 no longer exist, detention ceases to be justified and the person concerned shall be released immediately. 5. Detention shall be maintained for as long a period as the conditions laid down in paragraph 1 are fulfilled and it is necessary to ensure successful removal. Each Member State shall set a limited period of detention, which may not exceed six months. 6. Member States may not extend the period referred to in paragraph 5 except for a limited period not exceeding a further twelve months in accordance with national law in cases where regardless of all their reasonable efforts the removal operation is likely to last longer owing to: (a) a lack of cooperation by the third-country national concerned, or (b) delays in obtaining the necessary documentation from third countries.’
6 Article 2(h) of Directive 2013/33 defines detention as ‘confinement of an applicant by a Member State within a particular place, where the applicant is deprived of his or her freedom of movement’.
7 Article 8(1) to (3) of that directive provides: ‘1. Member States shall not hold a person in detention for the sole reason that he or she is an applicant in accordance with Directive 2013/32/EU of the European Parliament and of the Council of 26 June 2013 on common procedures for granting and withdrawing international protection [(OJ 2013 L 180, p. 60)]. 2. When it proves necessary and on the basis of an individual assessment of each case, Member States may detain an applicant, if other less coercive alternative measures cannot be applied effectively. 3. An applicant may be detained only: (a) in order to determine or verify his or her identity or nationality; (b) in order to determine those elements on which the application for international protection is based which could not be obtained in the absence of detention, in particular when there is a risk of absconding of the applicant; (c) in order to decide, in the context of a procedure, on the applicant’s right to enter the territory; (d) when he or she is detained subject to a return procedure under Directive [2008/115], in order to prepare the return and/or carry out the removal process, and the Member State concerned can substantiate on the basis of objective criteria, including that he or she already had the opportunity to access the asylum procedure, that there are reasonable grounds to believe that he or she is making the application for international protection merely in order to delay or frustrate the enforcement of the return decision; (e) when protection of national security or public order so requires; (f) in accordance with Article 28 of [the Dublin III Regulation]. The grounds for detention shall be laid down in national law.’
8 Article 9(3) of Directive 2013/33 states: ‘Where detention is ordered by administrative authorities, Member States shall provide for a speedy judicial review of the lawfulness of detention to be conducted ex officio and/or at the request of the applicant. When conducted ex officio, such review shall be decided on as speedily as possible from the beginning of detention. When conducted at the request of the applicant, it shall be decided on as speedily as possible after the launch of the relevant proceedings. To this end, Member States shall define in national law the period within which the judicial review ex officio and/or the judicial review at the request of the applicant shall be conducted. Where, as a result of the judicial review, detention is held to be unlawful, the applicant concerned shall be released immediately.’
9 Article 28(2) to (4) of the Dublin III Regulation is worded as follows: ‘2. When there is a significant risk of absconding, Member States may detain the person concerned in order to secure transfer procedures in accordance with this Regulation, on the basis of an individual assessment and only in so far as detention is proportional and other less coercive alternative measures cannot be applied effectively. 3. Detention shall be for as short a period as possible and shall be for no longer than the time reasonably necessary to fulfil the required administrative procedures with due diligence until the transfer under this Regulation is carried out. Where a person is detained pursuant to this Article, the period for submitting a take charge or take back request shall not exceed one month from the lodging of the application. The Member State carrying out the procedure in accordance with this Regulation shall ask for an urgent reply in such cases. Such reply shall be given within two weeks of receipt of the request. Failure to reply within the two-week period shall be tantamount to accepting the request and shall entail the obligation to take charge or take back the person, including the obligation to provide for proper arrangements for arrival. Where a person is detained pursuant to this Article, the transfer of that person from the requesting Member State to the Member State responsible shall be carried out as soon as practically possible, and at the latest within six weeks of the implicit or explicit acceptance of the request by another Member State to take charge or to take back the person concerned or of the moment when the appeal or review no longer has a suspensive effect in accordance with Article 27(3). When the requesting Member State fails to comply with the deadlines for submitting a take charge or take back request or where the transfer does not take place within the period of six weeks referred to in the third subparagraph, the person shall no longer be detained. Articles 21, 23, 24 and 29 shall continue to apply accordingly. 4. As regards the detention conditions and the guarantees applicable to persons detained, in order to secure the transfer procedures to the Member State responsible, Articles 9, 10 and 11 of Directive [2013/33] shall apply.’
10 Article 59a(1) of the Vreemdelingenwet 2000 (Law on foreign nationals of 2000) of 23 November 2000 (Stb. 2000, No 495; ‘the Law on foreign nationals’) states that foreign nationals to whom the Dublin III Regulation applies may, in compliance with Article 28 of that regulation, be detained with a view to their transfer to the Member State responsible for examining their application for international protection lodged in the Netherlands.
11 Article 59(1)(a) of that law provides that, if required in the interests of public policy or national security, a foreign national who is not lawfully resident may be placed in detention by the State Secretary with a view to his or her removal from the territory of the Netherlands.
12 Article 94(1) and (6) of that law reads as follows: ‘1. Where our Minister has taken a decision imposing a measure involving deprivation of liberty as referred to in Articles 6, 6a, 58, 59, 59a and 59b, he or she shall notify the court no later than the twenty-eighth day following service of that decision, unless the foreign national has by then brought an appeal. As soon as the court has been notified, the foreign national shall be deemed to have lodged an appeal against the decision imposing a measure involving deprivation of liberty. That appeal shall also seek an award of compensation. … 6. If the court before which proceedings are brought finds that the application or enforcement of the measure concerned is contrary to this Law or, after weighing up all the interests involved, that the measure is not justified, it shall uphold the appeal. In those circumstances, the court shall order that the measure be lifted or that the conditions of its enforcement be varied.’
13 Article 96(1) and (3) of that law provides as follows: ‘1. If the appeal referred to in Article 94 is declared unfounded and the foreign national lodges an appeal against the extension of the deprivation of liberty, the court shall terminate the preliminary investigation within one week of receipt of the application. By way of derogation from Article 8:57 of the Algemene wet bestuursrecht [(General Statute on Administrative Law)], the court may also decide, without the consent of the parties, that the inquiry hearing shall not take place. … 3. If the court before which proceedings are brought finds that the application or enforcement of the measure concerned is contrary to this Law or, after weighing up all the interests involved, that the measure is not reasonably justified, it shall uphold the appeal. In those circumstances, the court shall order that the measure be lifted or that the conditions of its enforcement be varied.’
14 On 2 May 2024, C was the subject of a detention measure under Article 59a(1) of the Law on foreign nationals (‘the first detention measure’). In adopting that measure, the State Secretary considered, first, that C was likely to come within the scope of the Dublin III Regulation, second, that he posed a significant risk to public policy owing to a risk of absconding and, third, that the Kingdom of Spain was the Member State responsible for examining his application for international protection. It is apparent from the order for reference that detention was imposed on the person concerned with a view to his transfer to that Member State.
15 On 3 May 2024, the State Secretary asked the Spanish authorities to take charge of C, pursuant to Article 18(1)(a) of the Dublin III Regulation. Those authorities rejected that request on 14 May 2024.
16 At 14.51 on 17 May 2024, the Secretary of State adopted a return decision in respect of C, designating Morocco as the country of destination. Considering that there was a risk that the person concerned, who was not legally resident, could abscond before his removal, that authority, at 14.52, then imposed a detention measure on the basis of Article 59(1)(a) of the Law on foreign nationals (‘the second detention measure’). That measure is still in force. At 14.55 on the same day that authority withdrew the first detention measure.
17 The person concerned brought two actions against the first and second detention measures before the Rechtbank Den Haag, zittingsplaats Roermond (District Court, The Hague, sitting in Roermond, Netherlands), which is the referring court.
18 C argues before that court that the first detention measure became unlawful on 14 May 2024, the date from when that measure, given the Kingdom of Spain’s refusal to take charge of him, could no longer be justified by the transfer of the person concerned to that Member State. On the basis of the case-law of the Afdeling bestuursrechtspraak van de Raad van State (Administrative Jurisdiction Division of the Council of State, Netherlands), the State Secretary had 48 hours from that date to maintain the detention of the person concerned on a different basis to that of the first detention measure. That time limit was exceeded in the present case since that authority did not adopt the second detention measure until 17 May 2024. Consequently, C could not be kept in detention and should have been released before the adoption of the second detention measure.
19 The State Secretary submits before the referring court that the unlawfulness of the first detention measure does not affect the lawfulness of the second detention measure, which justifies the continued detention of the person concerned on an independent basis. That authority, while acknowledging the error affecting the first detention measure and offering EUR 100 to C in damages to compensate him for the unlawful detention to which he was subject, argues that the first detention measure had already been withdrawn at the time the matter was brought before the referring court and that that measure therefore cannot be annulled.
20 The referring court observes that in accordance with national practice, confirmed by the case-law of the Afdeling bestuursrechtspraak van de Raad van State (Administrative Jurisdiction Division of the Council of State), the unlawfulness of a detention measure issued in respect of a third-country national cannot in principle affect the lawfulness of a detention measure adopted subsequently in respect of that person, with the result that the competent court cannot release the national in question on the ground of that unlawfulness. That practice and case-law are in fact in line with Articles 59, 59a, 94 and 96 of the Law on foreign nationals, which do not expressly require the competent judicial authority to immediately release the person concerned if it considers that his or her detention is unlawful.
21 The referring court observes, however, that under Article 15(2) of Directive 2008/115 and Article 9(3) of Directive 2013/33, the person concerned must be released ‘immediately’ if his or her detention is found to be unlawful.
22 Having regard to the obligation for immediate release foreseen by those provisions, the referring court raises the question of whether it should proceed to release the person concerned even though the detention measure under which that person is currently deprived of his liberty is not vitiated by unlawfulness solely on the ground that a previous detention measure, which led to that person being deprived of his liberty, no longer satisfied the conditions of lawfulness.
23 In that regard, it observes, first, that that question means that it must determine whether the subject matter of the review by the competent judicial authority is the condition of being in ‘detention’, or whether that authority should limit its review to the possible unlawful nature of the detention measure in force. According to the referring court, in that latter case, the possibility of proceeding to release the person concerned would ultimately depend on the time when he raises the claim that that measure was unlawful, while the fact that the detention was vitiated by unlawfulness in the past would not be a relevant factor in the analysis carried out by the competent judicial authority. In such a situation, that court would not be able to guarantee the right to effective judicial protection laid down in Article 47 of the Charter.
24 Second, the referring court observes that EU law does not afford the possibility of continuing the detention for administrative reasons or to prepare the adoption of a new detention measure, but requires the immediate release of a third-country national whose detention is unlawful, irrespective of when the lawfulness of that detention is reviewed.
25 Third, the referring court notes that, in accordance with the case-law of the Afdeling bestuursrechtspraak van de Raad van State (Administrative Jurisdiction Division of the Council of State), it is possible, in the event of a serious infringement of the right to be released, to depart from the rule that the unlawfulness of an initial detention measure does not affect the lawfulness of a second detention measure.
26 According to the referring court, the fundamental nature of the right to liberty laid down in Article 6 of the Charter and the right to effective judicial protection argues in favour of the view that any detention ordered on the basis of an unlawful detention measure entails a serious infringement of those rights. Accordingly, the person concerned should be released immediately where detention has been vitiated by unlawfulness in the past, even if the competent authority has ultimately remedied that unlawfulness.
27 In that context, the payment of compensation does not ensure sufficient protection of the rights enshrined in Articles 6 and 47 of the Charter. The duration and seriousness of the unlawfulness of the detention should be taken into account in order to determine the amount of compensation to be granted to the person concerned.
28 In the present case, since the detention was maintained for more than 48 hours, despite the unlawful nature of the first detention measure, and since the second detention measure was not imposed until after the first measure had been withdrawn, only the immediate release of the person concerned offers sufficient protection for his right to effective judicial protection.
29 In those circumstances, the Rechtbank Den Haag, zittingsplaats Roermond (District Court, The Hague, sitting in Roermond) decided to stay the proceedings and to refer the following question to the Court of Justice for a preliminary ruling: ‘Are Article 15(2), [third subparagraph], (b) of Directive [2008/115], Article 9(3) of Directive [2013/33] and Article 28(4) of [the Dublin III Regulation], read in conjunction with Articles 6 and 47 of [the Charter] to be interpreted as meaning that the judicial authority is always obliged to release the detained person immediately if [that] detention has been or has become unlawful at any time during the continuous implementation of a series of successive detention measures?’
30 The referring court requested that this reference for a preliminary ruling be dealt with under the urgent preliminary ruling procedure provided for in the first paragraph of Article 23a of the Statute of the Court of Justice of the European Union and in Article 107 of the Rules of Procedure of the Court.
31 In support of its request, the court submitted, first of all, that the question referred for a preliminary ruling concerns provisions falling within one of the areas covered by Title V of Part Three of the FEU Treaty. It also observed that C has been held in detention uninterruptedly since 2 May 2024. Lastly, the Court of Justice’s answer to the question referred for a preliminary ruling is decisive for rendering a ruling as to whether the referring court is required, under EU law, to release the person concerned immediately.
32 In the first place, it should be stated that this reference for a preliminary ruling concerns the interpretation of provisions set out in Directive 2008/115, Directive 2013/33 and in the Dublin III Regulation. Inasmuch as those two directives and that regulation fall within the scope of Title V of Part Three of the FEU Treaty, relating to the area of freedom, security and justice, the present reference for a preliminary ruling can be dealt with under the urgent preliminary ruling procedure, in accordance with the first paragraph of Article 23a of the Statute of the Court of Justice of the European Union and Article 107(1) of the Rules of Procedure.
33 In the second place, as regards the condition relating to urgency, it should be observed that that condition is satisfied in particular where the person concerned in the main proceedings is currently deprived of liberty and when his or her continued detention turns on the outcome of the dispute in the main proceedings, it being specified that the situation of the person concerned must be assessed as it stood at the time when consideration was given to whether the reference for a preliminary ruling should be dealt with under the urgent procedure (judgment of 29 July 2024, Breian, C‑318/24 PPU, EU:C:2024:658, paragraph 26 and the case-law cited).
34 In the present case, it is apparent from the referring court’s description of the facts that C has in fact been deprived of his liberty since 2 May 2024 and that he was in that condition at the time when consideration was given to whether the reference for a preliminary ruling should be dealt with under the urgent preliminary ruling procedure. In addition, the referring court has stated that, depending on the Court’s answer to the question referred, it might be led to release that person.
35 In those circumstances, the First Chamber of the Court decided on 14 June 2024, acting on a proposal from the Judge-Rapporteur and after hearing the Advocate General, to grant the referring court’s request for the present reference for a preliminary ruling to be dealt with under the urgent preliminary ruling procedure.
36 As a preliminary point, it should be borne in mind that, according to settled case-law, in the procedure laid down by Article 267 TFEU providing for cooperation between national courts and the Court of Justice, it is for the latter to provide the national court with an answer which will be of use to it and enable it to determine the case before it. To that end, the Court should, where necessary, reformulate the questions referred to it. In that regard, it is for the Court to extract from all the information provided by the national court, in particular from the grounds of the order for reference, the points of EU law which require interpretation, having regard to the subject matter of the dispute (judgment of 30 April 2024, M.N. (EncroChat), C‑670/22, EU:C:2024:372, paragraph 78 and the case-law cited).
37 In that regard, as is apparent from point 53 of the Advocate General’s Opinion, it should be noted that the referring court, in the question submitted for a preliminary ruling, cites only Article 15(2) of Directive 2008/115, however, Article 15(4), in that it requires the immediate release of the person concerned where the conditions set out in Article 15(1) no longer exist and detention ceases to be justified, is also relevant in the present case.
38 In that context, it should also be pointed out that the Court has not been asked in the present case about the compatibility with EU law of the 48-hour period foreseen under Netherlands law, referred to in paragraph 18 above. Consequently, it is not necessary to assess the compatibility, with the obligation for the ‘immediate’ release of the person concerned laid down in Article 9(3) of Directive 2013/33, to which Article 28(4) of the Dublin III Regulation refers, of a national practice which permits the competent authorities to maintain an applicant for international protection in detention for a maximum period of 48 hours after the circumstance establishing the unlawfulness of a detention measure adopted on the basis of that regulation has arisen.
39 An assessment of that kind concerns, in essence, the grounds that may substantiate that a detention measure adopted on the basis of the Dublin III Regulation is unlawful, whereas, in the present case, the referring court departs from the premiss that the first detention measure is unlawful and wishes to determine whether such unlawfulness affects the legality of the second detention measure, adopted on the basis of Directive 2008/115. Furthermore, it is common ground that, according to the referring court, the unlawfulness of the first detention measure does not stem from the possible incompatibility of that 48-hour period with the obligation for immediate release, but from the fact that the second detention measure was imposed 24 hours after that period expired.
40 In those circumstances, it must be held that, by its question, the referring court asks, in essence, whether Article 15(2) and (4) of Directive 2008/115, Article 9(3) of Directive 2013/33 and Article 28(4) of the Dublin III Regulation, read in the light of Articles 6 and 47 of the Charter, must be interpreted as precluding national legislation which does not require the competent judicial authority to order the release of a third-country national, who is in detention pursuant to a measure adopted on the basis of Directive 2008/115, on the ground that that person, whose detention had initially been ordered pursuant to a measure adopted on the basis of the Dublin III Regulation, had not been released immediately after a finding that that latter measure had become unlawful.
41 In that regard, it should be observed that any detention of a third-country national, whether under Directive 2008/115 in the context of a return procedure as a result of an illegal stay, under Directive 2013/33 in the context of the processing of an application for international protection, or under the Dublin III Regulation in the context of the transfer of an applicant for such protection to the Member State responsible for examining his or her application, constitutes a serious interference with the right to liberty enshrined in Article 6 of the Charter (judgment of 8 November 2022, Staatssecretaris van Justitie en Veiligheid and X (Ex officio review of detention), C‑704/20 and C‑39/21, EU:C:2022:858, paragraph 72 and the case-law cited).
42 As Article 2(h) of Directive 2013/33 provides, a detention measure consists in the confinement of a person within a particular place. It is apparent from the wording, origin and context of that provision, the scope of which can, moreover, be transposed to the concept of ‘detention’ in Directive 2008/115 and in the Dublin III Regulation, that detention requires the person concerned to remain permanently within a restricted and closed perimeter, thus isolating that person from the rest of the population and depriving him or her of his or her freedom of movement (judgment of 8 November 2022, Staatssecretaris van Justitie en Veiligheid and X (Ex officio review of detention), C‑704/20 and C‑39/21, EU:C:2022:858, paragraph 73 and the case-law cited).
43 In view of the gravity of that interference with the right to liberty enshrined in Article 6 of the Charter and of the importance of that right, the power of the competent national authorities to detain third-country nationals is strictly circumscribed. A detention measure may thus be ordered or extended only in compliance with the general and abstract rules laying down the conditions and procedures governing such a measure (judgment of 8 November 2022, Staatssecretaris van Justitie en Veiligheid and X (Ex officio review of detention), C‑704/20 and C‑39/21, EU:C:2022:858, paragraph 75 and the case-law cited).
44 Furthermore, where it is apparent that the conditions governing the lawfulness of detention laid down in Directive 2008/115, Directive 2013/33 and the Dublin III Regulation, and in the provisions of national law implementing them, have not been or are no longer satisfied, the person concerned must, as the EU legislature indeed expressly states in the fourth subparagraph of Article 15(2) and Article 15(4) of Directive 2008/115 and in the second subparagraph of Article 9(3) of Directive 2013/33, be released immediately (judgment of 8 November 2022, Staatssecretaris van Justitie en Veiligheid and X (Ex officio review of detention), C‑704/20 and C‑39/21, EU:C:2022:858, paragraph 79).
45 The general and abstract rules, referred to in paragraph 43 above, laying down, as common EU standards, the conditions pertaining to detention are set out, on the one hand, as regards the detention of illegally staying third-country nationals, in Article 15(1), the second subparagraph of Article 15(2) and in Article 15(4) to (6) of Directive 2008/115. On the other hand, as regards the situation of a third-country national who has applied for international protection, the relevant rules are laid down in Article 8(2) and (3) and Article 9(1), (2) and (4) of Directive 2013/33, and, where the issue concerns detention ordered in the context of the transfer of an applicant for such protection to the Member State responsible for examining his or application under the Dublin III Regulation, in Article 28(2) to (4) of that regulation (see, to that effect, judgment of 8 November 2022, Staatssecretaris van Justitie en Veiligheid and X (Ex officio review of detention), C‑704/20 and C‑39/21, EU:C:2022:858, paragraph 76). It should also be borne in mind that Article 28(4) of the Dublin III Regulation expressly provides that Article 9 of Directive 2013/33 is to apply in the context of the transfer procedures governed by that latter regulation.
46 As regards the issue of whether the unlawfulness of a measure to detain an applicant for international protection adopted on the basis of the Dublin III Regulation, with a view to the transfer of that applicant to the Member State responsible for examining his or her application, affects the lawfulness of a subsequent detention measure adopted on the basis of Directive 2008/115 and concerning that person, who has been held uninterruptedly in detention and who no longer has the status of an applicant for international protection, but who may henceforth be regarded as an illegally staying third-country national, it should be observed, in the first place, that detention for the purpose of removal, governed by Directive 2008/115, and detention of an asylum seeker, in particular under Directive 2013/33 and the applicable national provisions, fall under different legal rules (see, to that effect, judgment of 30 November 2009, Kadzoev, C‑357/09 PPU, EU:C:2009:741, paragraph 45).
47 Accordingly, a detention measure in respect of an illegally staying third-country national, adopted with a view to his or her return, must comply with the rules stemming from Directive 2008/115. A detention measure adopted in respect of an applicant for international protection must, for its part, comply with the rules arising from Directive 2013/33 and the Dublin III Regulation.
48 Furthermore, Article 15(2) and (4) of Directive 2008/115 does not allude or refer back to the conditions relating to the lawfulness of detention provided for in Articles 8 and 9 of Directive 2013/33 and in Article 28 of the Dublin III Regulation, which govern the detention of an applicant for international protection.
49 In the second place, it is apparent from Article 2(1) of Directive 2008/115, read in conjunction with recital 9 thereof, that that directive applies to third-country nationals staying illegally on the territory of a Member State and that an applicant for international protection should not be regarded as staying illegally on the territory of the Member State where he or she has applied for that protection until a negative decision on the application, or a decision ending his or her right of stay as asylum seeker has entered into force. The Court has also held that Directive 2008/115 does not apply to a third-country national who has applied for international protection within the meaning of Directive 2013/32 during the period from the making of the application to the adoption of the decision at first instance on that application or, as the case may be, until the outcome of any action brought against that decision is known (see, to that effect, judgment of 30 May 2013, Arslan, C‑534/11 PPU, EU:C:2013:343, paragraph 49).
50 It follows that an applicant for international protection, to the extent that he or she possesses that status, may not be detained simultaneously under Directive 2013/33 or the Dublin III Regulation and under Directive 2008/115 as an illegally staying third-country national.
51 In the third place, as is apparent from points 58, 59 and 61 of the Advocate General’s Opinion, a detention measure may be adopted under Directive 2008/115 following detention imposed under Directive 2013/33 or the Dublin III Regulation. Indeed, although Directive 2008/115 is not applicable during the procedure in which an application for asylum is examined, that does not mean that the return procedure is thereby definitively terminated, as it may continue if the application for asylum is rejected. In effect, the objective of that directive, namely the effective return of illegally staying third-country nationals, would be undermined if it were impossible for Member States to prevent the person concerned from automatically securing release by making an application for asylum (judgment of 30 May 2013, Arslan, C‑534/11, EU:C:2013:343, paragraph 60).
52 Furthermore, as regards the possibility of maintaining the detention of a third-country national, the Court has held that that objective of Directive 2008/115 would be compromised if it were impossible for Member States to prevent, by deprivation of liberty, a person suspected of staying illegally from fleeing before his or her situation could even be clarified (see, to that effect, judgment of 6 December 2011, Achughbabian, C‑329/11 PPU, EU:C:2011:807, paragraph 30).
53 In those circumstances, it must be held that the lack of lawfulness of a measure to detain an applicant for international protection, adopted on the basis of the Dublin III Regulation with a view to the transfer of that applicant to the Member State responsible for examining his or her application, does not in principle affect the lawfulness of a subsequent detention measure, adopted on the basis of Directive 2008/115 and concerning that person, who has been held in detention uninterruptedly and who no longer has the status of an applicant for international protection, but who may henceforth be regarded as an illegally staying third-country national. Consequently, the competent judicial authority is not required immediately to release that person merely because of the unlawful nature of a previous detention measure adopted on the basis of the Dublin III Regulation.
54 In any event, it should be pointed out that, as is apparent from the case-law of the Court, if the maintenance of a measure involving deprivation of liberty is to be in keeping with the objective of protecting the individual from arbitrariness, that means, in particular, that there can be no element of bad faith or deception on the part of the authorities, that it is consistent with the purpose of the restrictions permitted by the relevant subparagraph of Article 5(1) of the European Convention for the Protection of Human Rights, signed in Rome on 4 November 1950, and that the deprivation of liberty concerned is proportionate in relation to the ground relied on (see, to that effect, judgment of 15 February 2016, N., C‑601/15 PPU, EU:C:2016:84, paragraph 81).
55 The conclusion set out in paragraph 53 above is not called into question by the referring court’s consideration that the award of compensation to a person who has been detained unlawfully does not provide sufficient redress for the infringement of the right to liberty that has been suffered and does not safeguard the right to effective judicial protection laid down in Article 47 of the Charter.
56 It is indeed settled case-law that, under Article 47 of the Charter, the Member States must ensure effective judicial protection of rights which individuals derive from EU law (judgment of 8 November 2022, Staatssecretaris van Justitie en Veiligheid and X (Ex officio review of detention), C‑704/20 and C‑39/21, EU:C:2022:858, paragraph 81 and the case-law cited).
57 In that respect, the EU legislature has not confined itself to establishing common substantive standards, but has also established common procedural standards, the purpose of which is to ensure that, in each Member State, there is a system which enables the competent judicial authority to release the person concerned, where appropriate after an examination of its own motion, as soon as it is apparent that his or her detention is not, or is no longer, lawful. In order that such a system of protection effectively ensures compliance with the strict conditions which a detention measure covered by Directive 2008/115, Directive 2013/33 or the Dublin III Regulation is required to satisfy in order to be lawful, the competent judicial authority must be in a position to rule on all matters of fact and of law relevant to the review of that lawfulness. To that end, it must be able to take into account the facts stated and the evidence adduced by the administrative authority which ordered the initial detention (judgment of 8 November 2022, Staatssecretaris van Justitie en Veiligheid and X (Ex officio review of detention of own motion), C‑704/20 and C‑39/21, EU:C:2022:858, paragraphs 86 and 87).
58 However, first, as regards the right to liberty, as the Advocate General observes, in essence, in point 73 of his Opinion, a finding that a detention measure is unlawful does not in every case imply the immediate release of the person concerned (see, by analogy, judgment of 10 September 2013, G. and R., C‑383/13 PPU, EU:C:2013:533, paragraphs 39 and 40), allowing that person to have his or her rights re-established, where such re-establishment is no longer practically possible since the further detention of that person has been properly substantiated on another, independent legal basis. That is why compensation must as a rule be envisaged for persons who have been detained without basis so as to remedy the damage suffered as a result of unlawful deprivation of liberty.
59 Second, as regards the right to effective judicial protection laid down in Article 47 of the Charter, it should be observed that, as the Netherlands Government confirmed at the hearing, the referring court may order the State Secretary to pay a greater amount of compensation than that specifically offered by that authority in the present case. Accordingly, the fact that the State Secretary offered EUR 100 in damages in respect of the harm suffered by C, owing to the fact that the period for release prescribed by national law had been exceeded by 24 hours, does not appear to be sufficient to establish in and of itself that there has been an infringement of that right in the circumstances characterising the present case.
60 Lastly, it should be recalled that, for the reasons which led to the finding set out in paragraph 53 above, and in circumstances such as those that characterise the case in the main proceedings, the unlawfulness of the first detention measure cannot, in principle, affect the lawfulness of the second detention measure, as adopted on the basis of Directive 2008/115.
61 Having regard to all of those considerations, the answer to the question referred is that Article 15(2) and (4) of Directive 2008/115, Article 9(3) of Directive 2013/33 and Article 28(4) of the Dublin III Regulation, read in the light of Articles 6 and 47 of the Charter, must be interpreted as not precluding national legislation which does not require the competent judicial authority to order the release of a third-country national, who is in detention pursuant to a measure adopted on the basis of Directive 2008/115, on the ground that that person, whose detention had initially been ordered pursuant to a measure adopted on the basis of the Dublin III Regulation, had not been released immediately after a finding that that latter measure had become unlawful.
62 Since these proceedings are, for the parties to the main proceedings, a step in the action pending before the referring court, the decision on costs is a matter for that court. Costs incurred in submitting observations to the Court, other than the costs of those parties, are not recoverable.