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.