It is clearly apparent from the wording, scheme and purpose of Directives 2005/85 and 2008/115 that an asylum seeker, independently of the granting of a residence permit, which, under Article 7(1) of Directive 2005/85 is left to the discretion of each Member State, has the right to remain in the territory of the Member State concerned at least until his application has been rejected at first instance, and cannot therefore be considered to be ‘illegally staying’ within the meaning of Directive 2008/115, which relates to his removal from that territory.

Article 2(1) of Directive 2008/115 on common standards and procedures in Member States for returning illegally staying third-country nationals, read in conjunction with recital 9 in the preamble, must be interpreted as meaning that that directive does not apply to a third-country national who has applied for international protection within the meaning of Directive 2005/85 on minimum standards on procedures in Member States for granting and withdrawing refugee status, 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.

Directives 2003/9 laying down minimum standards for the reception of asylum seekers and 2005/85 on minimum standards on procedures in Member States for granting and withdrawing refugee status do not preclude a third-country national who has applied for international protection within the meaning of Directive 2005/85 after having been detained under Article 15 of Directive 2008/115 on common standards and procedures in Member States for returning illegally staying third-country nationals from being kept in detention on the basis of a provision of national law, where it appears, after an assessment on a case-by-case basis of all the relevant circumstances, that the application was made solely to delay or jeopardise the enforcement of the return decision and that it is objectively necessary to maintain detention to prevent the person concerned from permanently evading his return.

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. 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.

However, the mere fact that an asylum seeker, at the time of the making of his application, is the subject of a return decision and is being detained on the basis of Article 15 of Directive 2008/115 does not allow it to be presumed, without an assessment on a case-by-case basis of all the relevant circumstances, that he has made that application solely to delay or jeopardise the enforcement of the return decision and that it is objectively necessary and proportionate to maintain detention.

(see paras 60, 62, 63, operative part 2)