Second, in accordance with a teleological interpretation of Directive 2004/38, whilst it is true that the directive aims to facilitate and strengthen the exercise of the primary and individual right to move and reside freely within the territory of the Member States that is conferred directly on each citizen of the Union, the fact remains that the directive concerns the conditions governing the exercise of that right.

In that regard, first, on a literal interpretation of its provisions, Directive 2004/38 provides for a derived right of residence for third-country nationals who are family members of a Union citizen only where that citizen has exercised his right of freedom of movement by becoming established in a Member State other than the Member State of which he is a national.

Article 21(1) TFEU and Directive 2004/38 on the right of citizens of the Union and their family members to move and reside freely within the territory of the Member States do not confer any autonomous right on third-country nationals, but only rights derived from the exercise of the freedom of movement by a Union citizen.

Article 21(1) TFEU must be interpreted as meaning that, where a Union citizen has created or strengthened a family life with a third-country national during genuine residence, pursuant to and in conformity with the conditions set out in Article 7(1) and (2) and Article 16(1) and (2) of Directive 2004/38 on the right of citizens of the Union and their family members to move and reside freely within the territory of the Member States, in a Member State other than that of which he is a national, the provisions of that directive apply by analogy where that Union citizen returns, with the family member in question, to his Member State of origin. Therefore, the conditions for granting a derived right of residence to a third-country national who is a family member of that Union citizen, in the latter’s Member State of origin, should not, in principle, be more strict than those provided for by the directive for the grant of a derived right of residence to a third-country national who is a family member of a Union citizen and who has exercised his right of freedom of movement by becoming established in a Member State other than the Member State of which he is a national.

First, the grant, when a Union citizen returns to the Member State of which he is a national, of a derived right of residence to a third-country national who is a family member of that Union citizen and with whom that citizen has resided, solely by virtue of his being a Union citizen, pursuant to and in conformity with EU law in the host Member State, seeks to remove an obstacle on leaving his Member State of origin, by guaranteeing that that citizen will be able, in his Member State of origin, to continue the family life which he created or strengthened in the host Member State.

Second, so far as concerns the conditions for granting, when a Union citizen returns to the Member State of which he is a national, a derived right of residence to a third-country national who is a family member of that Union citizen, even though Directive 2004/38 does not cover such a return it is justifiable for it to be applied by analogy given that in both the case of a Union citizen who returns to his Member State of origin after having exercised his right to freedom of movement and the case of such a citizen who has merely resided in a Member State other than the one of which he is a national, it is the Union citizen who is the sponsor for the grant of a derived right of residence.

In that context, an obstacle to leaving the Member State of which the Union citizen is a national, created by the refusal to confer, when he returns to his Member State of origin, a derived right of residence on the family members of that worker who are third-country nationals, arises only where the residence of the Union citizen in the host Member State has been sufficiently genuine so as to enable that citizen to create or strengthen family life in that Member State. Thus, only genuine residence in the host Member State pursuant to and in conformity with the conditions set out in Article 7(1) of that directive is, in principle, evidence of settling there and therefore of the Union citizen’s genuine residence in the host Member State and goes hand in hand with creating and strengthening family life in that Member State, thereby creating, on the Union citizen’s return to the Member State of which he is a national, a derived right of residence, on the basis of Article 21(1) TFEU, for the third‑country national with whom that citizen lived as a family in the host Member State.

(see paras 49, 50-53, 56, 61, operative part)