In that regard, that definition stipulates that a visa is the ‘authorisation or decision of a Member State’ which is ‘required for transit or entry’ into the territory of that Member State or several Member States. It therefore follows from the actual wording which the EU legislature adopted that, first, the term ‘visa’ refers to an act formally adopted by a national authority, not to mere tolerance, and, second, a visa is not to be confused with admission to the territory of a Member State, since a visa is required precisely for the purposes of enabling such admission. That distinction is, moreover, consistent with the overall structure of EU legislation in the fields in question. Whereas provision was made for the rules governing admission into the territory of the Member States, at the time of the facts in the main proceedings, in the Schengen Borders Code, the conditions for issuing visas are set out in separate acts, such as, with respect to short-stay visas, the Visa Code.

It follows from that provision that the concept of a ‘visa’, within the meaning of the Dublin III Regulation, covers not only short-stay visas and airport transit visas, the procedures and issuing conditions for which are harmonised by the Visa Code, but also long-stay visas, which do not fall within the scope of that code and may, given the current absence of general measures adopted by the EU legislature on the basis of Article 79(2)(a) TFEU, be issued in accordance with national legislation (see, to that effect, judgment of 7 March 2017, X and X, C‑638/16 PPU , EU:C:2017:173 , paragraphs 41 and 44 ). In those circumstances, although the EU acts adopted in the field of visas form part of context to be taken into account in interpreting Article 2(m) and Article 12 of the Dublin III Regulation, the fact remains that the concept of a ‘visa’, within the meaning of that regulation, cannot be inferred directly from those acts and must be construed on the basis of the specific definition found in Article 2(m) and the general scheme of the regulation.

Article 2(m) of the Dublin III Regulation provides a general definition of the term ‘visa’ and stipulates that the nature of the visa is to be determined in accordance with more specific definitions relating to long-stay visas, short-stay visas and airport transit visas, respectively.

Article 12 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, read in conjunction with Article 2(m) of that regulation, must be interpreted as meaning that the fact that the authorities of one Member State, faced with the arrival of an unusually large number of third-country nationals seeking transit through that Member State in order to lodge an application for international protection in another Member State, tolerate the entry into its territory of such nationals who do not fulfil the entry conditions generally imposed in the first Member State, is not tantamount to the issuing of a ‘visa’ within the meaning of Article 12 of Regulation No 604/2013.

Article 13(1) of Regulation No 604/2013 must be interpreted as meaning that a third-country national whose entry was tolerated by the authorities of one Member State faced with the arrival of an unusually large number of third-country nationals seeking transit through that Member State in order to lodge an application for international protection in another Member State, without fulfilling the entry conditions generally imposed in the first Member State, must be regarded as having ‘irregularly crossed’ the border of the first Member State within the meaning of that provision.

In the light of the usual meaning of the concept of an ‘irregular crossing’ of a border, it must be concluded that the crossing of a border without fulfilling the conditions imposed by the legislation applicable in the Member State in question must necessarily be considered ‘irregular’, within the meaning of Article 13(1) of the Dublin III Regulation.

It follows that, where the border crossed is that of a Member State bound by the Schengen Borders Code, whether the crossing is irregular must be determined by taking into account, inter alia, the rules laid down by that code.

However, the finding in paragraph 74 above is not sufficient for the purpose of providing an exhaustive definition of the concept of an ‘irregular crossing’ within the meaning of Article 13(1) of the Dublin III Regulation. Regard must therefore be had to the fact that the rules on external border crossing may grant the competent national authorities the power to derogate, on humanitarian grounds, from the entry conditions generally imposed on third-country nationals in order to ensure that their future stay in the Member States is lawful. A power of that nature is provided for, inter alia, in Article 5(4)(c) of the Schengen Borders Code, which allows the Member States taking part in that code to authorise, by way of derogation, third-country nationals who do not fulfil one or more of the entry conditions generally imposed on those nationals to enter their territory on humanitarian grounds, on grounds of national interest or because of international obligations. That said, it should be noted, first of all, that Article 5(4)(c) of the Schengen Borders Code stipulates, unlike Article 5(4)(b) of that code, that such authorisation is valid only in respect of the territory of the Member State concerned, not the territory ‘of the Member States’ as a whole. Consequently, the former provision cannot have the effect of regularising the crossing of a border by a third-country national, admitted by the authorities of a Member State for the sole purpose of enabling the transit of that national to another Member State in order to lodge an application for international protection there.

In that context, it is apparent from the relationship between Articles 12 and 14 of the Dublin III Regulation that those articles cover, in principle, all the situations entailing lawful entry into the territory of the Member States, since, in the normal course of events, the lawful entry of a third-country national into that territory is based either on a visa or residence permit, or on waiver of the need to obtain a visa. The application of the various criteria laid down in those articles, and in Article 13 of the Dublin III Regulation, should, as a general rule, enable the responsibility for examining an application for international protection that may be lodged by a third-country national to be allocated to the Member State which that national first entered or stayed in upon entering in the territory of the Member States. In the light of the foregoing, the criteria laid down in Articles 12 to 14 of the Dublin III Regulation cannot, without calling into question the overall scheme of that regulation, be interpreted to the effect that a Member State is absolved of its responsibility where it has decided to authorise, on humanitarian grounds, the entry into its territory of a third-country national who does not have a visa and is not entitled to a waiver of the visa requirement.

Furthermore, the fact that, as in the present case, the third-country national in question entered the territory of the Member States under the watch of the competent authorities without in any way evading border control is not decisive for the application of Article 13(1) of the Dublin III Regulation.

The fact that the border crossing occurred in a situation characterised by the arrival of an unusually large number of third-country nationals seeking international protection cannot affect the interpretation or application of Article 13(1) of the Dublin III Regulation. In any event, it should be noted that, under the second subparagraph of Article 3(2) of the Dublin III Regulation and Article 4 of the Charter of Fundamental Rights of the European Union, an applicant for international protection must not be transferred to the Member State responsible where that transfer entails a genuine risk that the person concerned may suffer inhuman or degrading treatment within the meaning of Article 4 of the Charter (see, to that effect, judgment of 16 February 2017, C. K. and Others, C‑578/16 PPU, EU:C:2017:127, paragraph 65). Such an applicant cannot therefore be transferred if, following the arrival of an unusually large number of third-country nationals seeking international protection, such a risk existed in the Member State responsible.

(see paras 74, 75, 77-80, 86, 87, 89, 90, 93, 101, 102, operative part 2)