CELEX: 62009CC0325
Language: en
Date: 2011-02-17 00:00:00
Title: Opinion of Advocate General Trstenjak delivered on 17 February 2011. # Secretary of State for Work and Pensions v Maria Dias. # Reference for a preliminary ruling: Court of Appeal (England & Wales) (Civil Division) - United Kingdom. # Free movement of persons - Directive 2004/38/EC - Article 16 - Right of permanent residence - Periods completed before the date of transposition of that directive - Legal residence - Residence based solely on a residence permit issued pursuant to Directive 68/360/EEC, without the conditions governing eligibility for any right of residence having been satisfied. # Case C-325/09.

OPINION OF ADVOCATE GENERAL
      TRSTENJAK
      of 17 February 2011 (1)
      
      Case C‑325/09
      Secretary of State for the Home Department
      v
      Maria Dias
      (Reference for a preliminary ruling from the Court of Appeal (England and Wales) (Civil Division) (United Kingdom))
      (Free movement of persons – Directive 2004/38/EC – Article 16 – Right of permanent residence – Taking into account periods of residence which ended before the transposition period for the directive expired on 30 April
         2006 – Whether period of residence was lawful – Effects of a period of residence which does not constitute legal residence within the meaning of Article 16(1) of Directive
         2004/38 and which follows a period of legal residence within the meaning of that provision)
      
      1.        In this reference for a preliminary ruling, the Court of Appeal (‘the referring court’) again poses questions to the Court
         of Justice concerning the interpretation of Article 16 Directive 2004/38/EC of the European Parliament and of the Council
         of 29 April 2004 on the right of citizens of the Union and their family members to move and reside freely within the territory
         of the Member States amending Regulation (EEC) No 1612/68 and repealing Directives 64/221/EEC, 68/360/EEC, 72/194/EEC, 73/148/EEC,
         75/34/EEC, 75/35/EEC, 90/364/EEC, 90/365/EEC and 93/96/EEC. (2) The first sentence of Article 16(1) of Directive 2004/38 provides that citizens of the Union who have resided legally for
         a continuous period of five years in the host Member State acquire the right of permanent residence there.
      
      2.        The present case has a close connection with Lassal, in which the Court delivered its judgment on 7 October 2010. (3) The present case also concerns the question to what extent in the context of Article 16 of Directive 2004/38 periods of residence
         which ended before the transposition period for that directive expired on 30 April 2006 are to be taken into account. However,
         the question raised by the present case goes further, whether a Union citizen can acquire a right of residence where she first
         resided legally for a continuous period of more than five years in the host Member State and that residence was followed by
         a period of slightly more than one year, in which admittedly there was no right of residence according to the provisions of
         European Union law then applicable, but the Union citizen held a residence permit issued and not revoked by the national authorities.
         The present case offers the Court the opportunity to develop its case-law concerning Article 16 of the directive.
      
      I –  Applicable law
      A –    European Union law (4)
      
      1.      Primary law
      3.        Article 12(1) EC provides:
      
      ‘Within the scope of application of this Treaty, and without prejudice to any special provisions contained therein, any discrimination
         on grounds of nationality shall be prohibited.’
      
      4.        Article 18 EC provides that:
      
      ‘(1)      Every citizen of the Union shall have the right to move and reside freely within the territory of the Member States, subject
         to the limitations and conditions laid down in this Treaty and by the measures adopted to give it effect.
      
      (2)      If action by the Community should prove necessary to attain this objective and this Treaty has not provided the necessary
         powers, the Council may adopt provisions with a view to facilitating the exercise of the rights referred to in paragraph 1.
         The Council shall act in accordance with the procedure referred to in Article 251.
      
      (3)      Paragraph 2 shall not apply to provisions on passports, identity cards, residence permits or any other such document or to
         provisions on social security or social protection.’
      
      2.      Secondary law 
      (a) Directive 2004/38
      5.        Recitals 1 to 3 in the preamble to Directive 2004/38 are worded as follows:
      
      ‘(1)  Citizenship of the Union confers on every citizen of the Union a primary and individual right to move and reside freely within
         the territory of the Member States, subject to the limitations and conditions laid down in the Treaty and to the measures
         adopted to give it effect.
      
      (2) The free movement of persons constitutes one of the fundamental freedoms of the internal market, which comprises an area
         without internal frontiers, in which freedom is ensured in accordance with the provisions of the Treaty.
      
      (3)      Union citizenship should be the fundamental status of nationals of the Member States when they exercise their right of free
         movement and residence. It is therefore necessary to codify and review the existing Community instruments dealing separately
         with workers, self-employed persons, as well as students and other inactive persons in order to simplify and strengthen the
         right of free movement and residence of all Union citizens.’
      
      6.        Recitals 17 and 18 in the preamble to Directive 2004/38 read as follows:
      
      ‘(17) Enjoyment of permanent residence by Union citizens who have chosen to settle long term in the host Member State would strengthen
         the feeling of Union citizenship and is a key element in promoting social cohesion, which is one of the fundamental objectives
         of the Union. A right of permanent residence should therefore be laid down for all Union citizens and their family members
         who have resided in the host Member State in compliance with the conditions laid down in this Directive during a continuous
         period of five years without becoming subject to an expulsion measure.
      
      (18)      In order to be a genuine vehicle for integration into the society of the host Member State in which the Union citizen resides,
         the right of permanent residence, once obtained, should not be subject to any conditions.’
      
      7.        Article 7 of Directive 2004/38 states:
      
      ‘Right of residence for more than three months
      (1) All Union citizens shall have the right of residence on the territory of another Member State for a period of longer than
         three months if they 
      
      (a) are workers or self-employed persons in the host Member State; or 
      (b) have sufficient resources for themselves and their family members not to become a burden on the social assistance system
         of the host Member State during their period of residence and have comprehensive sickness insurance cover in the host Member
         State; or 
      
      …
      (3) For the purposes of paragraph 1(a), a Union citizen who is no longer a worker or self-employed person shall retain the
         status of worker or self-employed person in the following circumstances:
      
      (a) he/she is temporarily unable to work as the result of an illness or accident;
      (b) he/she is in duly recorded involuntary unemployment after having been employed for more than one year and has registered
         as a job-seeker with the relevant employment office;
      
      (c) he/she is in duly recorded involuntary unemployment after completing a fixed‑term employment contract of less than a year
         or after having become involuntarily unemployed during the first twelve months and has registered as a job-seeker with the
         relevant employment office. In this case, the status of worker shall be retained for no less than six months;
      
      (d) he/she embarks on vocational training. Unless he/she is involuntarily unemployed, the retention of the status of worker
         shall require the training to be related to the previous employment.
      
      ...’
      8.        Article 14(3) of Directive 2004/38 provides:
      
      ‘An expulsion measure shall not be the automatic consequence of a Union citizen’s or his or her family member’s recourse to
         the social assistance system of the host Member State.’
      
      9.        Article 16 of Directive 2004/38 sets out the general rule as to the right of permanent residence. It provides:
      
      ‘General rule for Union citizens and their family members
      (1)      Union citizens who have resided legally for a continuous period of five years in the host Member State shall have the right
         of permanent residence there. This right shall not be subject to the conditions provided for in Chapter III.
      
      ...
      (3)      Continuity of residence shall not be affected by temporary absences not exceeding a total of six months a year, or by absences
         of a longer duration for compulsory military service, or by one absence of a maximum of 12 consecutive months for important
         reasons such as pregnancy and childbirth, serious illness, study or vocational training, or a posting in another Member State
         or a third country.
      
      (4)      Once acquired, the right of permanent residence shall be lost only through absence from the host Member State for a period
         exceeding two consecutive years.’
      
      10.      Article 24 of Directive 2004/38 provides:
      
      ‘Equal treatment
      (1) Subject to such specific provisions as are expressly provided for in the Treaty and secondary law, all Union citizens
         residing on the basis of this Directive in the territory of the host Member State shall enjoy equal treatment with the nationals
         of that Member State within the scope of the Treaty. The benefit of this right shall be extended to family members who are
         not nationals of a Member State and who have the right of residence or permanent residence.
      
      (2) By way of derogation from paragraph 1, the host Member State shall not be obliged to confer entitlement to social assistance
         during the first three months of residence or, where appropriate, the longer period provided for in Article 14(4)(b), nor
         shall it be obliged, prior to acquisition of the right of permanent residence, to grant maintenance aid for studies, including
         vocational training, consisting in student grants or student loans to persons other than workers, self-employed persons, persons
         who retain such status and members of their families.’
      
      11.      Article 37 of Directive 2004/38 provides:
      
      ‘More favourable national provisions
      The provisions of this Directive shall not affect any laws, regulations or administrative provisions laid down by a Member
         State which would be more favourable to the persons covered by this Directive.’
      
      12.      Article 38 of Directive 2004/38 provides:
      
      ‘Repeal
      (1) Articles 10 and 11 of Regulation (EEC) No 1612/68 shall be repealed with effect from 30 April 2006.
      (2) Directives 64/221/EEC, 68/360/EEC, 72/194/EEC, 73/148/EEC, 75/34/EEC, 75/35/EEC, 90/364/EEC, 90/365/EEC and 93/96/EEC
         shall be repealed with effect from 30 April 2006.
      
      (3) References made to the repealed provisions and Directives shall be construed as being made to this Directive.’
      13.      Under Article 40(1) of Directive 2004/38, Member States are to bring into force the laws, regulations and administrative provisions
         necessary to comply with the directive by 30 April 2006 at the latest.
      
       b)     Directive 68/360
      14.      Article 4(1) and (2) of Council Directive 68/360/EEC of 15 October 1968 on the abolition of restrictions on movement and residence
         within the Community for workers of Member States and their families (5) provide as follows:
      
      ‘(1) Member States shall grant the right of residence in their territory to the persons referred to in Article 1 who are able
         to produce the documents listed in paragraph 3. 
      
      (2) As proof of the right of residence, a document entitled “Residence Permit for a National of a Member State of the EEC”
         shall be issued. This document must include a statement that it has been issued pursuant to Regulation (EEC) No 1612/68 and
         to the measures taken by the Member States for the implementation of the present Directive. The text of such statement is
         given in the Annex to this Directive.’
      
      15.      Article 6(1) of Directive 68/360 provides:
      
      ‘Residence permits 
      (a)       must be valid throughout the territory of the Member State issuing it; 
      (b)       must be valid for at least five years from the date of issue and be automatically renewable.’
      16.      Article 7(1) of Directive 68/360 states:
      
      ‘A valid residence permit may not be withdrawn from a worker solely on the grounds that he is no longer in employment, either
         because he is temporarily incapable of work as a result of illness or accident, or because he is involuntarily unemployed,
         this being duly confirmed by the competent employment office.’
      
      B –    National law
      17.      Under the relevant national legislation, income support is a means-tested benefit for people aged between 16 and 59 who are
         not required to sign on for jobseeker’s allowance because, for example, they are in the later stages of pregnancy, incapable
         of work or lone parents. 
      
      18.      The right to income support is governed by the Social Security Contributions and Benefits Act 1992 (‘the 1992 Act’). According
         to section 124(1)(b) of the 1992 Act, there is an entitlement to income support where the income of the person concerned does
         not exceed the ‘applicable amount’. Under section 135(1) of the 1992 Act, the applicable amount is the amount or the aggregate
         of such amounts prescribed in relation to that benefit. According to section 135(2) of the 1992 Act, the power to prescribe
         applicable amounts includes power to prescribe nil as an applicable amount. 
      
      19.      Under Regulations 21 and 21AA of and Annex 7 to the Income Support (General) Regulations 1987 (‘the 1987 Regulations’), the
         applicable amount in the case of a person for abroad is nil, meaning that persons from abroad are not entitled to income support.
         
      
      20.      The expression person from abroad is defined in Regulation 21AA(1) of the 1987 Regulations as a claimant who is not habitually
         resident in the United Kingdom, the Channel Islands, the Isle of Man, or the Republic of Ireland. 
      
      Under Regulation 21AA(2), no claimant is to be treated as habitually resident in the United Kingdom, the Channel Islands,
         the Isle of Man or the Republic of Ireland unless he has a right to reside in the United Kingdom, the Channel Islands, the
         Isle of Man or the Republic of Ireland, other than a right to reside which falls within Regulation 21AA(3).
      
      21.      Regulation 21AA(3) excludes inter alia the following rights of residence:
      
      –        Rights of residence based on the entitlement of an EU citizen to reside in a State other than his own for an initial period
         of three months;
      
      –        Rights of residence based on the entitlement of an EU citizen to reside after that period but who are jobseekers or members
         of their family.
      
      22.      Regulation 21AA(4) provides that certain persons are not to be counted as ‘persons from abroad’ and are therefore entitled
         to claim income support. That category includes in particular EU citizens who are workers or otherwise self-supporting. 
      
      II –  Facts and the proceedings before the referring court 
      23.      Maria Dias is a Portuguese national. She is unmarried. She went to the UK in January 1998 with her two children, and found
         employment there immediately. The two children with whom she arrived are now adults and no longer live with her. 
      
      24.      Ms Dias’ residence in the United Kingdom can be divided into the following periods: 
      
      –        From January 1998 to summer 2002 (‘period 1’) she was a worker;
      –        From summer 2002 to 17 April 2003 (‘period 2’) she was on maternity leave. Her youngest child was born on 7 October 2002.
      –        Following her maternity leave, she voluntarily decided temporarily not to return to work, but from 18 April 2003 to 25 April
         2004 (‘period 3’) looked after her youngest child. During that period she received income support under the then prevailing
         national rules. (6)
      
      –        From 26 April 2004 to 23 March 2007 (‘period 4’), she returned to work and was therefore again a worker; 
      –        Since 24 March 2007 (‘period 5’), Ms Dias has again been out of work.
      25.      On 13 May 2000 (during period 1), the Home Office issued Ms Dias with a residence permit. The permit reads as follows: 
      
      ‘Residence Permit for a national of a Member State of the EEC.
      This permit is issued pursuant to Regulation (EEC) No 1612/68 of the Council for the European Communities of 15 October 1968
         and to the measures taken on the implementation of the Council Directive of 15 October 1968 [Directive 68/360].
      
      In accordance with the provisions of the abovementioned Regulation, the holder of this permit has the right to take up and
         hold employment in the UK under the same conditions as UK workers. 
      
      You are advised to produce this permit to the Immigration Officer whenever you enter or leave the United Kingdom.’
      26.      The document was valid from its issue on 13 May 2000 until 13 May 2005. Notes printed on it drew the holder’s attention in
         particular to the fact that: 
      
      ‘The validity of this permit is the time-limit on your stay in the UK. This time‑limit will apply, unless superseded, to any
         subsequent leave to enter you may obtain after an absence from the UK within the period of the validity of this permit.’
      
      27.      On 26 March 2007, that is in period 5, following the expiry of the period for transposition of Directive 2004/38 on 30 April
         2006, Ms Dias claimed income support. According to the national law applicable at that time, the success of her application
         for income support depends on whether she already enjoyed a right of permanent residence at that time under Article 16(1)
         of Directive 2004/38. 
      
      28.      Following rejection of her application, Ms Dias appealed to the Social Security Commissioner against that rejection. The Social
         Security Commissioner decided that her application for income support was well founded, because she had a right of permanent
         residence under Article 16 of Directive 2004/38. Admittedly, her residence during periods 1 and 2, that is from the beginning
         of January 1998 until 17 April 2003, could not be taken into account. Under Article 16(1) of Directive 2004/38, only periods
         of residence which ended after 30 April 2006, that is after the period for transposition of Directive 2004/38 had expired,
         could be taken into account. On the other hand it was possible to take into account Ms Dias’ residence in periods 3 and 4.
         It was admittedly true that in period 3 Ms Dias was not a worker and was also not self-sufficient. The residence permit granted
         by the national authorities however gave her a right to reside. Moreover, in that period she derived a right of residence
         directly from Article 18 EC. 
      
      29.      The Secretary of State appealed, and Ms Dias cross-appealed, against that decision of the Social Security Commissioner, to
         the referring court. In its reference for a preliminary ruling, the referring court came to the following interim conclusion:
         
      
      30.      First of all, it expressed the provisional point of view that both Article 16(1) and Article 16(4) of Directive 2004/38 applied
         to periods of residence which ended before 30 April 2006, in so far as they were in conformity with the then applicable European
         legislation. Since Ms Dias had resided legally for a continuous period of five years – from the beginning of January 1998
         until 17 April 2003 – within the meaning of Article 16(1) of the directive, in the United Kingdom, she acquired a right of
         permanent residence on 30 April 2006. The court however deferred its final decision on the point pending the delivery of the
         Court’s judgment in Lassal.
      
      31.      The referring court also addressed the question whether period 3 might also constitute legal residence within the meaning
         of Article 16(1) of the directive. In that context, it concluded that Ms Dias was not a worker during that period. The mere
         fact that the residence permit with which she was issued by the national authorities was valid for that period did not suffice
         to make that period legal residence within the meaning of Article 16(1) of Directive 2004/38. Since the court however continued
         to have doubts, it deferred its final decision and referred the following question to the Court for a preliminary ruling:
      
      ‘If a European Union citizen, present in a Member State of which she is not a national, was, prior to the transposition of
         Directive 2004/38/EC, the holder of a residence permit validly issued pursuant to Article 4(2) of Directive 68/360/EEC, but
         was for a period of time during the currency of the permit voluntarily unemployed, not self-sufficient and outside the qualifications
         for the issue of such a permit, did that person by reason only of her possession of the permit, remain during that time someone
         who “resided legally” in the host Member State for the purpose of later acquiring a permanent right of residence under Article
         16(1) of Directive 2004/38?’
      
      32.      In the event that a right of permanent residence cannot be derived from Article 16(1) of Directive 2004/38, the referring
         court asks whether Ms Dias can derive a right of residence directly from Article 18 EC and therefore referred the following
         question to the Court for a preliminary ruling:
      
      ‘If five years’ continuous residence as a worker prior to 30 April 2006 does not qualify to give rise to the permanent right
         of residence created by Article 16(1) of Directive 2004/38/EC, does such continuous residence as a worker give rise to a permanent
         right of residence directly pursuant to Article 18(1) EC on the grounds that there is a lacuna in the Directive?’
      
      III –  Procedure before the Court 
      33.      Ms Dias, the United Kingdom, the Portuguese Republic, the Kingdom of Denmark and the Commission submitted written observations
         within the period laid down in Article 23 of the Statute of the Court of Justice.
      
      34.      There was a hearing on 16 December 2010 in which the representatives of Ms Dias, of the United Kingdom and of the European
         Commission took part. 
      
      IV –  Principal arguments of the parties
      A –    The taking into account of periods of residence which ended before 30 April 2006 
      35.      According to MsDias, the Portuguese Government and the Commission, periods of residence which ended before 30 April 2006 are also to be taken into account pursuant to Article 16(1) of Directive
         2004/38. Ms Dias therefore satisfied the conditions of Article 16(1) of the directive, because she resided legally for a continuous
         period of more than five years, from January 1998 until 17 April 2003, in the United Kingdom and therefore attained the level
         of integration required in order to acquire a right of permanent residence. Ms Dias refers to the arguments of the Child Poverty Action Group which was a party in the proceedings in Lassal and the Commission to its own arguments in the present proceedings. The Portuguese Government notes that Directive 2004/38
         codified the rules which existed before it entered into force. According to recital 3 in the preamble to the directive, its
         objective is to simplify and strengthen the right of free movement. The directive may not therefore be interpreted so that
         it falls below the level of already existing rights. 
      
      36.      At the hearing, the Government of the United Kingdom made clear that, in the light of the Lassal judgment, it also proceeds on the assumption that Ms Dias’ residence in periods 1 and 2 can be taken into account and that
         Ms Dias has therefore already acquired a right of permanent residence. 
      
      37.      According to the Danish Government, periods of residence which ended before 30 April 2006 cannot be taken into account pursuant to Article 16(1) of Directive
         2004/38. The fact that the directive does not take into account periods of residence before 30 April 2006 is not an unintended
         lacuna of the directive, but a deliberate decision by the European Union legislature. The right of permanent residence under
         Article 16 of Directive 2004/38 is a new right which was only introduced by the directive.
      
      B –    First question referred 
      38.      According to Ms Dias and the Portuguese Government, Ms Dias’ residence in period 3 was legal residence within the meaning of Article 16(1) of Directive 2004/38. 
      
      39.      Ms Dias relies first on the argument that the wording of that provision permits a period of residence to be taken into account
         which admittedly is not legal residence according to the provisions of European Union law but is under those of national law.
         She was issued by the national authorities with a residence permit under Article 6 of Directive 68/360 which was valid for
         period 3. She therefore resided legally in the United Kingdom during period 3. That argument is supported by a comparison
         of the provisions of Directive 68/360 with Articles 1 and 3 of Council Directive 90/364/EEC of 28 June 1990 on the right of
         residence. (7) It also cannot be countered that, according to the case-law, a residence permit issued pursuant to Article 6 of Directive
         68/360 is merely declaratory in nature. That case-law is authority only for the proposition that a right of residence under
         European Union law does not depend on compliance with national procedures; it does not mean, conversely, that a national residence
         permit has no effect. Furthermore, in the present case it is not the provisions on registration in Article 8 of Directive
         2004/38 which must be taken into account, but merely those concerning the residence permit in Directive 68/360. In addition,
         it is also not possible to conclude from Article 16 of Directive 2004/38 or from recital 17 in its preamble that the conditions
         of Article 7 of Directive 2004/38 must be fulfilled before there can be legal residence within the meaning of Article 16(1)
         of the directive. According to the spirit and purpose of Directive 2004/38, it may also not be interpreted restrictively.
         In particular, it may not be interpreted so as to restrict the effect of Article 18 EC or the goal pursued by it of promoting
         social cohesion. Finally, there is no connection between Articles 16 and 7 of the directive, meaning that for the purposes
         of Article 16 residence need not necessarily be based on residence in accordance with Article 7.
      
      40.      According to the Portuguese Government, Ms Dias did not lose her status as worker during period 3. She was admittedly voluntarily
         unemployed. Since however she was not working so that she could look after her six-month old child, she remained integrated
         in the labour market in the United Kingdom. The national residence permit merely confirmed the right resulting from her status
         as worker.
      
      41.      According to the United Kingdom Government, the Danish Government and the Commission, Ms Dias’ residence in period 3 did not constitute legal residence within the meaning of Article 16(1) of Directive 2004/38.
         The fact that her residence was based on a residence permit granted by the national authorities is not sufficient to establish
         such residence. 
      
      42.      The Danish Government and the Commission argue, first, that that can be inferred from recital 17 in the preamble to the directive,
         according to which residence within the meaning of Article 16(1) of the directive must comply with the conditions laid down
         in the directive. In addition, according to Article 14(2) of the directive, Union citizens enjoy a right of residence only
         where they fulfil the conditions laid down in Article 7 of the directive. The Danish Government also refers to the fact that
         the directive consolidates pre-existing rights of residence under European Union law. Finally, the Commission emphasises that
         the right of permanent residence under Article 16(1) of the directive is the most favourable status that can be conferred
         on a Union citizen from another Member State and therefore requires a high level of integration. 
      
      43.      Second, the United Kingdom Government, the Danish Government and the Commission state that the residence permit granted by
         the national authorities is irrelevant. It only recognises, in a declaratory sense, that Ms Dias enjoys a right of residence
         on the basis of relevant European Union provisions. A Member State may revoke the residence permit in the case of voluntary
         unemployment. Ms Dias’ residence in period 3 may not however be regarded as legal residence within the meaning of Article
         16(1) of Directive 2004/38 on the sole ground that the national authorities did not revoke Ms Dias’ residence permit. Otherwise,
         Member States would be required to keep a constant check on whether the conditions for the grant of the residence permit were
         still met. That would represent a disproportionate burden for the national authorities and risk discriminating against Union
         citizens of other Member States. 
      
      44.      Third, according to the Danish Government, an argument against taking into account a period of residence based on a residence
         permit issued by the national authorities is that Article 8 of Directive 2004/38 provides that for periods of residence longer
         than three months in the host State a Union citizen may be required to register. If such registration were taken into account
         in assessing the lawfulness of a period of residence, the concept of what was legal would be interpreted differently according
         to whether a Member State exercised the option in Article 8 or not. The United Kingdom Government adds in that connection
         that the objective of Article 8 of Directive 2004/38 is to obtain an overview of immigration and emigration.
      
      45.      Fourth, the Commission argues in the alternative that, should the Court not be of the same opinion, a further distinction
         should be drawn between two scenarios. Where the national authorities were unaware that the conditions for a right of residence
         based on European Union law no longer existed, the continued toleration of residence would not establish the existence of
         legal residence within the meaning of Article 16(1) of Directive 2004/38. On the other hand, legal residence within the meaning
         of that provision could be assumed where the national authorities deliberately allowed residence by a Union citizen going
         beyond the provisions of European Union law.
      
      46.      Fifth, the Commission adds that while a period of residence such as that in period 3 admittedly does not constitute legal
         residence within the meaning of Article 16(1) of Directive 2004/38, it does not interrupt the continuity of residence within
         the meaning of that provision. The directive is silent in relation to a case such as the present, in which a Union citizen
         resides continuously in the host Member State but did not during a certain period fulfil the conditions for legal residence
         within the meaning of Article 16(1) of the directive. By contrast, Article 16(3) of the directive makes special provision
         whereby continuity of residence is not affected by absences of a certain duration, which serve merely to ‘stop the clock’.
         It would strike a fair balance between the competing interests at stake to adopt that approach for periods of residence such
         as period 3 too. Such periods, unlike periods of absence of the Union citizen from the host State, do not in fact diminish
         the level of integration attained. That is also compatible with the legislature’s intention. It decided either that it was
         obvious that periods of voluntary unemployment did not interrupt residence and therefore failed to adopt any rules, or it
         simply overlooked the point. In that case, the directive should be interpreted, in the light of Article 18 EC, in conformity
         with primary law. An interpretation according to which periods of involuntary employment interrupted residence would be disproportionate.
         
      
      C –    Second question referred
      47.      Were the Court to hold that Ms Dias had not acquired a right of permanent residence according to Article 16(1) of Directive
         2004/38, it is the view of Ms Dias, the Portuguese Government and the Commission that Ms Dias can claim a right of permanent residence directly on the basis of Article 18 EC. The right of free movement
         of Union citizens is not exhaustively governed by Directive 2004/38. Article 18 EC therefore applies directly in cases in
         which no right of residence is provided for by Directive 2004/38 but where it would be disproportionate not to provide for
         one. In the case of Ms Dias, who has worked for over five years in the United Kingdom, it would be disproportionate not to
         grant her such a right of residence. 
      
      48.      According to the United KingdomGovernment and the Danish Government, Ms Dias cannot claim the right of permanent residence directly on the basis of Article 18 EC. The right of permanent residence
         under Article 16 of Directive 2004/38 is new and is expressly subject to the limitations and conditions laid down in that
         provision. In so far as a Union citizen does not fulfil the conditions referred to in Article 16 of Directive 2004/38, there
         is no lacuna which must be filled by direct application of Article 18 EC. That is because, under Article 18 EC, the right
         of residence is granted only subject to the limitations and conditions provided for in the Treaty. Thus, the European Union
         legislature alone has jurisdiction to determine the rules and conditions which apply to the right of residence. It must admittedly
         observe the principle of proportionality when doing so. It is however not disproportionate to make the right of permanent
         residence subject to the conditions laid down in Directive 2004/38.
      
      49.      The Danish Government also submits that the scope of Article 18(1) EC should be limited to residence in accordance with European
         Union law. The Court has admittedly extended the scope of Article 18 EC to a residence permit granted according to national
         law. It is not however apparent from the reference for a preliminary ruling that such a permit existed. 
      
      V –  Admissibility of the reference for a preliminary ruling
      50.      At the hearing, the United Kingdom Government conceded that Ms Dias enjoys a right of permanent residence. It pointed out
         however, first, that the proceedings before the referring court remain pending and, second, that the Secretary of State did
         not make a relevant declaration in the main proceedings. The lack of discussion of the Lassal judgment by the referring court in the main proceedings could probably be explained by the fact that those proceedings were
         stayed pending delivery of the judgment of the Court in the present case. The United Kingdom Government added that the referring
         court did not regard the first question referred for a preliminary ruling as hypothetical.
      
      51.      The fact that the United Kingdom Government, in reaction to the Lassal judgment, altered its legal opinion and now proceeds on the assumption that Ms Dias enjoys a right of permanent residence,
         does not mean that the Court no longer has jurisdiction to answer the questions referred. 
      
      52.      First, it should be pointed out that the system of references for a preliminary ruling under Article 267 TFEU is a procedure
         whereby the Court of Justice and the national courts cooperate with each other, over which the parties to the proceedings
         exercise no control. (8) The United Kingdom Government’s concession at the hearing is therefore irrelevant as such. The Court’s jurisdiction would
         cease only were the referring court to inform it that the main proceedings had been terminated. 
      
      53.      Second, it cannot be assumed that the questions asked in the order for reference are not relevant. In the present case, the
         question arises as to the effect of Ms Dias’ residence in period 3, when she was voluntarily unemployed but held a valid residence
         permit. The answer to that question depends in particular on how the Court answers the question whether Ms Dias’ residence
         in period 3 was legal residence within the meaning of Article 16(1) of Directive 2004/38. Furthermore, in the order for reference,
         the referring court not only posed expressly the questions referred for a preliminary ruling, it also wished to know whether
         Ms Dias’ residence in periods 1 and 2 was to be taken into account under Article 16(1) of the directive. In the light of the
         Lassal proceedings, the referring court decided not to refer that question again for a preliminary ruling. Since the present case
         is however distinct from Lassal in several respects, that question must for the purposes of the present case be answered by taking those specific issues into
         account. 
      
      54.      The request for a preliminary ruling is therefore admissible.
      
      VI –  Legal Assessment
      A –    Preliminary remarks
      1.      Right of permanent residence
      55.      By Directive 2004/38, the European Union legislature set out in secondary legislation the right of a Union citizen to reside
         in another Member State, which finds expression in primary law in the fundamental freedoms and the rules on Union citizenship.
         (9) The directive provides for three levels of residence rights: first, in Article 6, the right of residence for up to three
         months; second, in Article 7, the right of residence for more than three months, which applies principally to workers and
         otherwise to economically self-supporting persons or other persons to be assimilated to them; and third, the right of permanent
         residence. 
      
      56.      The right of permanent residence, which represents the highest level of integration of a Union citizen in a host Member State,
         is set out in Articles 16 to 21 of the directive. It is based on the consideration that it should be possible for a Union
         citizen who, after five years’ continuous legal residence in the host Member State, is substantially integrated there, to
         remain in that State, irrespective of whether following acquisition of that right he is a worker, is otherwise self‑supporting
         or is assimilated to those persons under Article 7 of the directive. 
      
      57.      The rights of residence in Directive 2004/38 must be viewed alongside the principle of equal treatment under Article 24 of
         the directive. 
      
      2.      The legal questions relevant in the present case 
      58.      In the main proceedings the referring court has to decide whether Ms Dias, a Portuguese national, who has been living in the
         United Kingdom since January 1998, is entitled to claim income support from the national authorities. That is the case where
         she enjoys a right of permanent residence pursuant to Article 16 of Directive 2004/38. It thus depends on whether Ms Dias
         resided legally for a continuous period of five years in the United Kingdom within the meaning of that provision. 
      
      59.      As is apparent from the order for reference, Ms Dias has resided continuously in the United Kingdom since January 1998. Her
         residence in periods 1 and 2, that is from January 1998 until 17 April 2003, already lasted for more than five years. Only
         taking into account those periods of time, Ms Dias would on 30 April 2006, that is the date on which the transposition period
         for Directive 2004/38 expired, already have resided for a continuous period of five years in the United Kingdom. 
      
      60.      The referring court wishes to know first whether, according to Article 16 of the directive Ms Dias’ residence in periods 1
         and 2 must also be taken into account. Her residence in those periods already took place before 30 April 2006, that is, before
         the expiry of the transposing period for the directive. Since the referring court had already referred a similar question
         for a preliminary ruling in Lassal, it decided not to refer the question again in the present case. In its order for reference it referred however to the fact
         that the answer to that question as referred in Lassal was also of decisive importance for its decision in the case before it. 
      
      61.      In its judgment in Lassal the Court made clear that there is legal residence within the meaning of Article 16(1) of Directive 2004/38 not only where
         the period of residence complied with the conditions laid down in that provision, but also where there was a right of residence
         at the time of the period of residence pursuant to European Union provisions then applicable. (10) Ms Dias’ residence in periods 1 and 2 was therefore also legal residence within the meaning of Article 16(1) of the directive.
         In periods 1 and 2, Ms Dias enjoyed, as a worker within the meaning of Article 39(3)(c) EC, a right of residence based on
         European Union law.
      
      62.      The present case is however distinct from Lassal in an important respect. The question arises whether the further period of residence of Ms Dias in period 3, which followed
         periods 1 and 2, precludes the coming into existence of a right of permanent residence. Following the end of her maternity
         leave in period 2, Ms Dias decided not to return to her previous job and was thus, in period 3, that is from 18 April 2003
         until 25 April 2004, voluntarily unemployed. Thereafter, in period 4, that is from 26 April 2004 until 23 March 2007, she
         was again a worker and thus resided legally in the United Kingdom within the meaning of Article 16(1) of the directive.
      
      63.      In those circumstances it can, in the following situations, be assumed that Ms Dias acquired a right of permanent residence
         on 30 April 2006, when the transposition period for Directive 2004/38 expired:
      
      –        First, were Ms Dias’ residence to be regarded as legal residence within the meaning of Article 16(1) of the directive. In
         that case Ms Dias would have resided not only in periods 1 and 2 but throughout periods 1 to 4, that is from January 1998
         until the expiry of the transposition period on 30 April 2006, and thus legally and for a continuous period of more than five
         years, in the United Kingdom; 
      
      –        Second, if Ms Dias’ residence in periods 1 and 2 were to be taken into account for the coming into existence of a right of
         permanent residence and if her residence in period 3 also did not preclude the coming into existence of a right of permanent
         residence, assuming it was not legal residence within the meaning of Article 16(1) of Directive 2004/38.
      
      64.      In what follows, I shall examine, first, whether Ms Dias’ residence in period 3 was legal residence within the meaning of
         Article 16(1) of Directive 2004/38 (B). I will then examine whether in a case such as the present a period of residence by
         Ms Dias which was not legal residence within the meaning of Article 16(1) of the directive precludes the acquisition of a
         right of permanent residence pursuant to that provision (C).
      
      B –    Whether residence in period 3 constituted legal residence
      65.      First, the question arises whether in period 3 Ms Dias resided legally within the meaning of Article 16(1) of Directive 2004/38.
         Directive 2004/38 uses the expression ‘resided legally’ in Article 16(1) but does not define it. 
      
      66.      It is apparent from recital 17 in the preamble to the directive that the European Union legislature understood that expression
         to mean ‘residence in compliance with the conditions laid down in this Directive’. As the Court explained in Lassal, that expression must be interpreted in accordance with the spirit and purpose of the directive to cover not only periods
         of residence which complied with the conditions laid down in Directive 2004/38 itself but also residence in accordance with
         the conditions provided for in the provisions which were the predecessors to those of the directive and applied at the time
         of the residence. (11)
      
      67.      In the present case, Ms Dias cannot rely concerning period 3 on a right of residence as worker (1). In some circumstances,
         a derived right of residence may be considered (2). The further question arises whether Ms Dias’ residence in period 3 is
         to be regarded as legal residence within the meaning of Article 16(1) of Directive 2004/38 on the sole ground that in that
         period she held a valid residence permit and claimed income support (3).
      
      1.      A worker’s right of residence
      68.      Ms Dias’ period of residence in period 3 would be legal residence within the meaning of Article 16(1) of Directive 2004/38
         if she had also been a worker in that period. The referring court held that not to be the case and in that regard did not
         refer a question for a preliminary ruling. 
      
      69.      The referring court’s conclusion that Ms Dias was not a worker in period 3 appears to be in conformity with the case-law of
         the Court. According to that case-law, once the employment relationship has ended, the status of worker is as a rule lost.
         (12) It is apparent from the order for reference that Ms Dias’ employment relationship ended when period 3 began, that is when
         she decided following the end of her maternity leave to continue to care for her son and not to go back to her job. Ms Dias
         thereby voluntarily lost her status of worker as such. 
      
      70.      That conclusion is also not altered by the fact that Ms Dias’ employer promised to reemploy her at a later date. The Court
         has in some cases admittedly found that the status of worker is not lost, despite a change of status, where there is a relationship
         between the activity as worker and the subsequent activity. (13) The mere fact that Ms Dias’ employer promised her that she could return to work for it does not in my opinion quite amount
         to a relationship sufficient in itself to establish that Ms Dias retained her status of worker in period 3. 
      
      71.      Ms Dias can also not base her status of worker on provisions of secondary law. Admittedly, Article 7(1) of Directive 68/360
         (14) provides that persons who are not workers within the meaning of that term are in certain circumstances to be assimilated
         to them. It makes such provision however only for persons who became unemployed involuntarily and not, on the other hand,
         for those in voluntary unemployment. 
      
      2.      A possible derived right of residence
      72.      It is conceivable that Ms Dias could in some circumstances derive a right of residence from her son’s status as a Union citizen.
         According to one point of view – which is not unchallenged – such a derived right may exist were Ms Dias’ youngest child a
         national of the United Kingdom and dependent on care by his mother. (15) The referring court did not however either refer such a question for a preliminary ruling or give any indication that Ms
         Dias’ youngest child is a national of the United Kingdom. In that light, and considering that the question is not decisive
         for the purposes of the present proceedings, I will not consider that issue further.
      
      3.      The significance of the residence permit 
      73.      The referring court asks the Court of Justice whether Ms Dias’ residence in period 3 is to be regarded as legal residence
         within the meaning of Article 16(1) of the directive, on the basis that at that time she held a valid residence permit issued
         by the national authorities. As I already suggested in my Opinion in Lassal, (16) that question should in my opinion be answered in the negative. Admittedly, the wording of Article 16 of the directive is
         sufficiently open also to apply to periods of residence which constitute legal residence according to national provisions (a).
         Recital 17 in the preamble to the directive (b) and the directive’s system of levels (c) argue however against such an interpretation.
         Moreover, neither Member States’ power to adopt more favourable provisions under Article 37 of the directive (d), nor primary
         law provisions (e) necessarily require an interpretation whereby periods of residence which are lawful under provisions of
         national law must be taken into account.
      
      a)      Wording
      74.      It must, first, be stated that the wording of Article 16(1) of Directive 2004/38 is open. It precludes neither an interpretation
         according to which only periods of residence on the basis of European Union law are taken into account, nor an interpretation
         going beyond that to include periods of residence which occurred on the basis of provisions of national law.
      
      b)      Recital 17 in the preamble to the directive
      75.      What is decisive is thus the spirit and purpose behind the European Union legislature’s adoption of Article 16 of Directive
         2004/38. According to recital 17 in the preamble to the directive, it pursues the goal of promoting social cohesion. Pursuant
         to recital 18 in the preamble, the directive is to be a genuine vehicle for integration of the Union citizen into the society
         of the host Member State. The point could therefore be made in that connection that the differences between rights of residence
         according to European Union law and national law are irrelevant in the light of those objectives and therefore that residence
         according only to national legal provisions is also to be regarded as legal residence within the meaning of Article 16(1)
         the directive. (17)
      
      76.      The European Union legislature did not however limit itself to referring only to those objectives in the recitals to the preamble.
         In recital 17 it is explained that a right of permanent residence depends on residence ‘in compliance with the conditions laid down in the Directive’. That wording, which was deliberately added to recital 17 during the legislative procedure, (18) must be taken into account when establishing the legislature’s intention. In my opinion it can hardly be understood to mean
         anything other than that the European Union legislature intended to create a right of permanent residence only on the basis
         of the rights of residence provided for in the directive. 
      
      c)      System of levels in the directive
      77.      That position is also supported by the system of levels laid down by the directive, which provides for three successive levels
         of integration of a Union citizen in the host Member State, that is as the first level the right of residence for up to three
         months, as the second level the right of residence for more than three months, which applies principally to workers and otherwise
         to self-supporting persons or other persons to be assimilated to them, and as the third and highest level of the right of
         permanent residence. (19)
      
      78.      That level-based approach is also the basis for the extent of the entitlements which a Union citizen may claim from the authorities
         of the host Member State under Article 24 of the directive. On the first level, the Member State is not obliged to provide
         for any entitlement to equal access to social assistance. On the second level, Union citizens have a limited right to social
         assistance. When a Union citizen reaches the second level, under Article 14(3) of Directive 2004/38 an expulsion measure may
         not be the automatic consequence of recourse to social assistance. On the other hand, disproportionate recourse in a particular
         case may lead to the loss of the right of residence. Only when the third level is reached, that is when the right of permanent
         residence is acquired, does the Union citizen acquire an unlimited right to social assistance. If he has attained that level,
         the right of permanent residence is unconditional, meaning that it may not therefore be called into question by recourse to
         social assistance. (20)
      
      79.      By means of that level-based system, the European Union legislature has achieved a balance between the Union citizen’s right
         of free movement in the Union and the objective of social cohesion, on the one hand, and the Member States’ financial interests,
         on the other. The greater the level of integration attained by the Union citizen in the host Member State, the less important
         are the Member States’ financial interests. When the third level is attained, those interests become completely secondary
         to the integration objective. (21)
      
      80.      Along with the right of permanent residence under Article 16 of Directive 2004/38, the Union citizen concerned acquires a
         comprehensive right of access to social assistance in the host Member State, which is also not limited in time. The clarification
         made in recital 17 in the preamble to the directive of the concept of legal residence must be seen in that light. In my opinion,
         the European Union legislature intended thereby to express that the financial interests of the Member States should be of
         completely secondary importance to the integration objective only in those cases in which the Union citizen has first spent
         at least five years in the host Member State in accordance with the provisions of Directive 2004/38.
      
      d)      The power to enact more favourable provisions 
      81.      It is countered that Article 37 of the directive allows Member States to adopt more favourable laws, regulations or administrative
         provisions and therefore itself provides for cases in which a right of residence is derived from the host Member State’s national
         law on foreign nationals. For that reason, periods of residence which took place on the basis of national law on foreign nationals
         must be regarded as periods of legal residence within the meaning of Article 16 of the directive. (22)
      
      82.      I am unable to derive such a meaning from Article 37 of Directive 2004/38. According to the wording of that provision, the
         directive is not to affect any more favourable laws or administrative provisions of the Member States. The European Union
         legislature usually chooses such words when it wishes to say that a directive is without prejudice to more favourable provisions
         under national law and that the Member States have discretion in that regard. Since the adoption of more favourable provisions
         lies in the discretion of the Member States, they should – in so far as there are no provisions of primary law – also enjoy
         discretion in relation to the question which legal consequences they wish to attach to a right of residence granted under
         national law which goes beyond the terms of the directive. In particular, they should therefore enjoy discretion with regard
         to the question whether they also wish to taken such a period of residence into account for the purposes of the coming into
         existence of a right of permanent residence. 
      
      83.      In any case Article 37 of the directive does not appear to me to be directly relevant in a case such as the present. In the
         present case Ms Dias is not claiming that she has a right under more favourable national provisions. She relies rather on
         a residence permit which the national authorities were obliged under Article 6 of Directive 68/360 to issue, and on the fact
         that they did not revoke that permit, although the conditions for issue of such a permit no longer existed.
      
      e)      The provisions of primary law
      84.      Furthermore, there is an argument that periods of residence according to national law should be taken into account, on the
         basis of the judgments of the Court of Justice in Trojani(23) and Martínez Sala . (24) It is said that in those cases the Court drew consequences of a European Union law character from residence which took place
         in accordance with the provisions of national law. (25)
      
      85.      In my opinion, it cannot be concluded from those judgments that residence which did not take place on the basis of a right
         of residence according to European Union law, but on the exclusive basis of a residence permit which was not revoked, must
         be regarded as legal residence within the meaning of Article 16(1) of Directive 2004/38. 
      
      86.      First, it must be noted that the Court did not hold, in those judgments, that in such a case there is a right of residence
         under Article 18 EC. Rather it held that not to be the case. (26)
      
      87.      Second, in those cases the Court admittedly drew legal consequences under European Union law from a period of residence which
         took place on the basis of a national residence permit or a leave to remain. It those cases it held however only that a Union
         citizen may in those circumstances base its claim for social assistance on the prohibition on discrimination under Article
         12 EC (and that such recourse to social assistance may not automatically entail an expulsion measure). In so far as Article
         18 EC is discussed in that context, it concerned only the question whether the scope of the prohibition on discrimination
         is affected. (27)
      
      88.      Third, the Court has made clear that it remains open to a Member State also in such a situation to remove a national who no
         longer fulfils the conditions applicable to his right of residence and has had recourse to social assistance, provided that
         it acts within the limits imposed by European Union law. (28)
      
      89.      It can be concluded from the foregoing that according to the case-law there is no rule of primary law according to which periods
         of residence which occurred on the basis of a national residence permit must be regarded as periods of legal residence within
         the meaning of Article 16(1) of Directive 2004/38. That would in fact lead to a situation where residence on the basis of
         a national right of residence alone would lead to the acquisition of a right of permanent residence. Such a right of permanent
         residence cannot unilaterally be brought to an end by the host Member State and, to be precise, not even where the Union citizen
         has recourse to social assistance. The Court has however expressly pointed out that in such a case it remains open to a Member
         State under the provisions of primary law to carry out an expulsion, provided that it acts within the limits imposed by European
         Union law. 
      
      90.      An interpretation in conformity with primary law also therefore does not allow the conclusion that a period of residence which
         took place on the basis only of a national residence permit or leave to remain granted by the national authorities, must be
         regarded as legal residence within the meaning of Article 16(1) of Directive 2004/38. 
      
      f)      Further considerations
      91.      It must finally be considered that an interpretation according to which a period of residence which took place in accordance
         with national law must also necessarily be taken into account under Article 16(1) of Directive 2004/38, can rebound to the
         detriment of free movement of Union citizens. First, there is a risk that the authorities of the host Member State would check
         more strictly whether a Union citizen satisfies the conditions for periods of residence based on European Union law. Second,
         there is a danger that the Member States would make only very limited use of their right under Article 37 of Directive 2004/38
         to adopt more favourable provisions. 
      
      g)      Interim conclusion
      92.      On the basis of the foregoing considerations, I conclude that legal residence within the meaning of Article 16(1) of Directive
         2004/38 does not include a period of residence which, as in the present case, took place on the sole basis of a national residence
         permit issued and not revoked by the national authorities. 
      
      4.      Conclusion
      93.      Ms Dias’ residence in period 3 in my opinion did not therefore already constitute legal residence within the meaning of Article
         16(1) of Directive 2004/38 because during that period she held a residence permit granted by the national authorities.
      
      C –    The effects of residence in period 3, where there had already been previous legal residence for a continuous period of more
            than five years 
      94.      As pointed out above,(29) Ms Dias may in the present case already have acquired a right of permanent residence because she resided legally in periods
         1 and 2 in the United Kingdom. In that connection, the question arises whether a right of permanent residence can also come
         into existence where a period of legal residence of more than five years as in periods 1 and 2 is followed by a period of
         residence in period 3 of just over a year, which is not legal residence within the meaning of Article 16(1) of Directive 2004/38,
         before that is in turn followed by further residence in period 4, which is legal residence within the meaning of that provision.
         
      
      95.      That question is to be distinguished from the question already dealt with, that is whether residence in period 3 was legal
         residence within the meaning of Article 16(1) of Directive 2004/38. The question at issue at this stage is whether residence
         in period 3, which was not legal residence within the meaning of Article 16(1) of the directive, is capable of diminishing
         the level of integration already attained by Ms Dias by her residence in periods 1 and 2. 
      
      96.      For the sake of clarification, it should be noted that that question is not applicable to periods of residence which ended
         after 30 April 2006. In that case a right of residence arises directly under Article 16 of the directive following legal residence
         for a continuous period of at least five years. A further period of residence, during which the Union citizen concerned is
         voluntarily unemployed, would therefore be covered by his right of permanent residence, meaning that – without prejudice to
         the loss of that right – it would no longer be possible for there to be a period of residence which was not legal residence
         within the meaning of Article 16(1) of the directive. 
      
      97.      Contrary to the opinion expressed by the Commission and the United Kingdom Government at the hearing, that question does indeed
         however arise in relation to periods of residence which ended before 30 April 2006. The fact that, according to Article 16
         of Directive 2004/38, periods of residence are also to be taken into account which occurred before 30 April 2006, does not
         change the position that a right of permanent residence can come into existence only on transposition of the directive or
         when the period for transposing it has expired. To that extent it is possible in cases such as the present that a period of
         legal and continuous residence of over five years in the host Member State is followed by a period of residence which is not
         covered by the right under Article 16(1) of the directive.
      
      1.      The rules in Article 16(1) and (4) of Directive 2004/38
      98.      The only conditions for the existence of a right of permanent residence under Article 16(1) of Directive 2004/38 are that
         there has been legal residence for a continuous period of more than five years in the host Member State. Those conditions
         are met here.
      
      99.      The right of permanent residence is lost under Article 16(4) of the directive only where the Union citizen concerned was absent
         from the host Member State. That is not the case here.
      
      2.      Possibility of applying Article 16(4) of Directive 2004/38 by analogy
      100. The question however arises whether Article 16(4) of the directive can be applied by analogy, when a Union citizen remains
         in the host Member State without residing there legally within the meaning of Article 16(1) of Directive 2004/38. In my opinion
         the rule in Article 16 of the directive contains an unintended legislative lacuna, which in certain cases must be filled by
         an analogous use of Article 16(4) of the directive (a). That should not however be considered in the present case (b).
      
      a)      Cases in which it would be appropriate to apply Article 16(4) of Directive 2004/38 by analogy
      101. Article 16 of Directive 2004/38 contains an unintended legislative lacuna with regard to cases in which a Union citizen remains
         illegally and contrary to the wishes of the host Member State in that State following a period of more than five years’ legal
         residence within the meaning of Article 16(1). 
      
      102. First, it cannot be assumed from the absence of a corresponding provision in Directive 2004/38 that the European Union legislature
         did not intend to take such periods of residence into account. It must be pointed out that the provisions of the directive
         were framed principally with regard to periods of future residence, that is residence after 30 April 2006. As explained above,
         (30) such a problem no longer arises after that date. Thus there is some substance in the argument that an unintended legislative
         lacuna exists with regard to periods of illegal residence contrary to the wishes of the host Member State which took place
         before 30 April 2006. 
      
      103. Second, the legislative evaluations which find expression in Article 16 of the directive constitute an argument for applying
         Article 16(4) by analogy in certain cases. 
      
      104. The origins of Directive 2004/38 indicate that the European Union legislature intended by Article 16 of the directive to grant
         Union citizens who have attained a certain level of integration in a host Member State a right of permanent residence in that
         State. (31) That right should exist as long as that level of integration is not diminished. (32) Article 16(1) of Directive 2004/38 indicates that the legislature concluded that a Union citizen attains the necessary level
         of integration to justify a right of permanent residence where he has resided legally for a continuous period of at least
         five years in the host Member State. (33) Article 16(4) of the directive indicates that only by an absence from the host Member State of more than two years is such
         a close link sufficiently loosened as to result in the grant of a right of permanent residence no longer being justified.
         (34) If those legislative evaluations are taken into account, an analogous application of Article 16(4) of the directive then
         seems justified, in a situation in which the level of integration attained by a Union citizen following legal residence for
         a continuous period of more than five years is gravely diminished to a degree comparable to that resulting from absence of
         more than two years. 
      
      105. In that connection, the question arises, first, whether that is at all possible where the Union citizen remained in the host
         State. It could be countered that continued residence in the host Member State could never gravely diminish the level of integration
         attained in the same way as absence from that State. That point of view appears to me to go too far. 
      
      106. First, the integration objective which lies behind Article 16 of the directive is based not only on territorial and time factors
         but also on qualitative elements. It therefore seems to me quite possible that unlawful conduct of a Union citizen may diminish
         his integration in the host State from a qualitative point of view. In so far as a Union citizen, following a period of legal
         residence in the host Member State, remains without a right of residence based on European Union law or national law in the
         host Member State, and the national authorities do not grant leave to remain, that can clearly in my view be taken into account
         from the perspective of integration. 
      
      107. Second, the principle of equal treatment also supports that point of view. A Union citizen who complies with the law, who
         did not remain unlawfully contrary to the wishes of the host Member State in that State, would not be entitled to a right
         of permanent residence on 30 April 2006 following absence for more than two years, pursuant to Article 16(4) of Directive
         2004/38. It does not seem justified to reward a Union citizen who does not comply with the law. 
      
      108. Third, without analogous application of Article 16(4) of Directive 2004/38 in such situations, a right of permanent residence
         would also be granted in cases which the legislature, when adopting the directive, could hardly have contemplated. If a period
         of unlawful residence contrary to the wishes of a Member State, which followed legal residence for a continuous period of
         five years within the meaning of Article 16(1) of the directive, could not be taken into account at all, a right of permanent
         residence would come into existence on 30 April 2006 in respect of a Union citizen who had resided legally for a continuous
         period of more than five years a very long time ago, for example in the 1970s, and who then remained illegally and contrary
         to the wishes of the host Member State in the host Member State. Clearly, the European Union legislature cannot have intended
         such a result when adopting Directive 2004/38.
      
      109. My interim conclusion therefore is that the analogous application of Article 16(4) of the Directive 2004/38 should be considered
         in those cases in which the Union citizen, following legal residence for a continuous period of more than five years, remained
         illegally and contrary to the wishes of the host Member State in that Member State.
      
      b)      The present case
      110. In the present case however Article 16(4) of the directive should not be applied by analogy. Taking into account the evaluations
         of the European Union legislature expressed in Article 16 of the directive, the application of that provision to Ms Dias’
         residence in period 3 is not justified. Her residence in that period cannot be compared either qualitatively or in terms of
         time to the type of case covered by Article 16(4).
      
      i)      Not qualitatively comparable
      111. First, Ms Dias’ period of residence in period 3 cannot be compared in qualitative terms to the case governed by Article 16(4)
         of the directive. Her residence in period 3 was not capable of diminishing the level of integration which she attained as
         a result of her activity as a worker in the United Kingdom for over five years to an extent comparable with that resulting
         from absence from that host Member State. 
      
      112. During period 3, Ms Dias held a valid residence permit. She cannot therefore be accused of having resided illegally in the
         United Kingdom during that period. 
      
      113. It cannot be countered, first, that Ms Dias did not satisfy the conditions for issue of a residence permit according to Article
         6 of Directive 68/360. As Ms Dias correctly points out, that did not affect the validity of her residence permit. Admittedly,
         that residence permit was issued by the national authorities pursuant to Article 6 of Directive 68/360 in order to enable
         her to exercise her right to freedom of movement as a worker effectively. That does not however mean that the validity of
         the residence permit depended on the conditions for its issue having been satisfied at all times. According to Article 6(1)(b)
         of Directive 68/360, the residence permit must be valid for at least five years. Article 7(1) of that directive makes clear
         that the permit may be revoked before the expiry of its validity only under specific conditions. Looking at those two provisions
         together, it is apparent that the residence permit is valid and thus takes effect either until its period of validity expires
         or until it is revoked by the national authorities. 
      
      114. Such a conclusion is also not precluded by the Court’s case-law on the effects of a residence permit under Article 6 of Directive
         68/360. The Court has admittedly decided on many occasions that such a residence permit is of only declaratory effect. (35) In my opinion it did not thereby mean to say that such a residence permit can have no effect at all of its own. That conclusion
         of the Court must be seen in the context of the cases concerned. Those cases concerned a situation where the conditions for
         a right of residence based on European Union law were admittedly met, but the Union citizen concerned had not been issued
         with a residence permit by the national authorities. In so far as the Court has explained that a residence permit is of merely
         declaratory effect, that therefore concerns only the situation in which the conditions for a right of residence enshrined
         in European Union law were met but the authorities had not issued a residence permit. The Court has merely pointed out in
         those cases that rights of residence granted under European Union law do not depend on compliance with national administrative
         procedures but are conferred on European Union citizens directly by the provisions of European Union law. The Court was silent
         in those cases on the question whether a residence permit can also have an effect where the conditions for a right of residence
         enshrined in European Union law are not met. 
      
      115. Second, it must be concluded that a period of residence such as that which occurred in period 3 was admittedly not legal residence
         within the meaning of Article 16(1) of the directive and was therefore not capable of establishing the level of integration
         required in accordance with that provision. (36) That does not however mean that residence in period 3, during which Ms Dias received income support in accordance with the
         provisions of national law applicable at that time, was such as to diminish the level of integration attained following legal
         residence for a continuous period of five years within the meaning of Article 16(1) of the directive. 
      
      116. The interim conclusion to be drawn is therefore that Ms Dias’ residence in period 3 cannot qualitatively be assimilated to
         absence from the Member State, the situation governed by Article 16(4) of the directive. An analogous application of Article
         16(4) to period 3 can therefore already for that reason be excluded.
      
      ii)    No comparable length of time 
      117. An analogous application of Article 16(4) of Directive 2004/38 to Ms Dias’ residence in period 3 is also not appropriate,
         since the length of that residence is not comparable with the period laid down in that provision. The European Union legislature
         in Article 16(4) of Directive 2004/38 regarded only absence for a period of more than two years as sufficient to diminish
         the level of integration attained following legal residence for a continuous period of five years in the host Member State.
         (37) It is not possible in my view in a case such as the present – in which a Union citizen has resided on the basis of a valid
         residence permit in the host Member State – to drop below that required period. For that reason too it would not be appropriate
         to apply Article 16(4) by analogy in the present case. 
      
      c)      Interim conclusion 
      118. Article 16(4) of Directive 2004/38 may not therefore be applied by analogy to Ms Dias’ residence in period 3.
      
      3.      Conclusion
      119. It must therefore be concluded that in the present case Ms Dias acquired a right of permanent residence on 30 April 2006 already
         on the basis of her residence in periods 1 and 2. Her residence in period 3 does not preclude such acquisition. 
      
      D –    The second question referred
      120. By the second question referred, the referring court wishes to know whether a continuous period of five years’ residence as
         worker in the host Member State before 30 April 2006, if it does not suffice in order to establish a right of permanent residence
         according to Article 16(1) of Directive 2004/38, may establish such a right directly on the basis of Article 18(1) EC. That
         question is posed in the alternative, were a right of permanent residence found not to exist under Article 16(1) of Directive
         2004/38. Since Ms Dias enjoys a right of permanent residence under Article 16(1) of Directive 2004/38, it is not necessary
         to examine that question.
      
      VII –  Summary
      121. In summary, it can be concluded that a period of residence of a Union citizen in a host Member State, which is not based on
         Directive 2004/38 or its predecessor provisions, but only on a residence permit granted by the national authorities, does
         not constitute legal residence within the meaning of Article 16(1) of that directive and cannot therefore be taken into account
         for the acquisition of a right of permanent residence. It is however open to the Member States to provide for a rule according
         to which such periods are taken into account.
      
      122. If a Union citizen has however resided before 30 April 2006 in accordance with the conditions of the predecessor provisions
         to Directive 2004/38 legally and for a continuous period of more than five years in the host Member State, a right of permanent
         residence under Article 16 of Directive 2004/38 also comes into force where that residence was followed by another period
         of residence which, while not legal residence within the meaning of Article 16(1) of Directive 2004/38, took place on the
         basis of a valid residence permit issued by the national authorities.
      
      VIII –  Conclusion
      123. On the basis of the foregoing considerations, I propose to the Court that it answer the question referred as follows:
      
      Article 16 of Directive 2004/38/EC of the European Parliament and of the Council of 29 April 2004 on the right of citizens
         of the Union and their family members to move and reside freely within the territory of the Member States amending Regulation
         (EEC) No 1612/68 and repealing Directives 64/221/EEC, 68/360/EEC, 72/194/EEC, 73/148/EEC, 75/34/EEC, 75/35/EEC, 90/364/EEC,
         90/365/EEC and 93/96/EEC is to be interpreted as meaning that a Union citizen who resided in a host Member State: 
      
      –        first, from January 1998 until 17 April 2003, that is for a continuous period of more than five years, in accordance with
         the provisions of secondary legislation applicable at that time; 
      
      –        then, from 18 April 2003 until 25 April 2004, that is for slightly more than one year, on the basis of a residence permit
         issued and not revoked by the national authorities; and 
      
      –        finally, until 30 April 2006, again in accordance with the provisions of secondary legislation applicable at that time, 
      obtained a right of permanent residence on the expiry of the transposition period for Directive 2004/38 on 30 April 2006.
      1 –	Original language:  German.
      
      	Language of the case:  English.
      2 	OJ 2004 L 158, p. 77; corrigenda: OJ 2004 L 229, p. 35 and OJ 2007 L 204, p. 28.
      
      3 –	Case C‑162/09 Lassal [2010] ECR I-0000.
      
      4 –	Drawing on the terminology used in the Treaty on European Union (EU Treaty) and the Treaty on the Functioning of the EU
         (TFEU), the expression ‘European Union law’ will be used to encompass both Community law and Union law. In so far as specific
         provisions of primary law are at issue in what follows, the applicable provisions will be cited ratione temporis.
      
      5 –	OJ 1968 L 257, p. 13.
      
      6 –	Those provisions of national law have in the meantime been amended: see points 17 to 22 of this Opinion.
      
      7 –	OJ 1990 L 180, p. 26.
      
      8 –	See to that effect Case 62/72 Bollmann [1973] ECR 269, paragraph 4; Case C-261/95 Palmisani [1997] ECR I‑4025, paragraph 31; and Case C-2/06 Kempter [2008] ECR I‑411, paragraph 41 et seq.
      
      9 –	See recitals 1 and 2 in the preamble to the directive.
      
      10 –	Lassal, paragraph 40 (see footnote 3 above).
      
      11 –	Lassal, paragraph 40 (see footnote 3 above).
      
      12 –	Case C-43/99 Leclere [2001] ECR I-4265, paragraph 55.
      
      13 –	Case 39/86 Lair [1988] ECR 3161, paragraph 37; Case C-357/89 Raulin [1992] ECR I-1027, paragraph 21; Case C-3/90 Bernini [1992] ECR 1071, paragraph 19.
      
      14 –	See now Article 7(3)(b) of Directive 2004/38.
      
      15 –	See to that effect the Opinion of Advocate General Sharpston of 30 September 2010 in Case C‑34/09 Ruiz Zambrano, points 67 to 122 (judgment still pending). Advocate General Kokott, on the other hand, in her Opinion of 25 November 2010
         in Case C-434/09 McCarthy, points 20 to 46 (judgment still pending), expresses the view that the rules on citizenship of the Union do not apply to
         such a situation.
      
      16 –	See my Opinion of 11 May 2010 in Lassal (cited in footnote 3 above, point 88).
      
      17 –	That seems to be the view of Advocate General Kokott in her Opinion in McCarthy (footnote 15 above, point  52). 
      
      18 –	The wording was not in fact contained in the Commission’s original proposal (see recital 14 in the preamble to the original
         Commission proposal, COM(2001) 257 final; OJ 2001 C 270 E, p. 150) but was subsequently included in the Council’s Common Position
         (EC) No 6/2004 of 5 December 2003 (OJ 2004 C 54 E, pp. 12, 13) and approved by the Parliament. In its Communication to the
         Parliament of 30 December 2003 concerning the common position of the Council, the Commission explained in relation to the
         additional wording in recital 17 in the preamble to the directive that the purpose of that wording was to clarify the expression
         legal residence (SEC (2003) 1293 final, p. 10). 
      
      19 –	See point 55 et seq. of this Opinion.
      
      20 –	Article 16(4) of the directive and recital 18 in its preamble.
      
      21 –	See to that effect Iliopoulou, A., ‘Le nouveau droit de séjour des citoyens de l’Union et des membres de leur famille:
         la directive 2004/38/CE’, Revue du Droit de l’Union Européenne, 2004, p. 523 et seq., at p. 540. 
      
      22 –	See the Opinon of Advocate General Kokott in McCarthy (footnote 15 above, paragraph 53). 
      
      23 –	Case C-456/02 Trojani [2004] ECR I‑ 7573, paragraphs 37 to 46.
      
      24 –	C-85/96 Martínez Sala [1998] ECR I-2691, paragraphs 61 to 63.
      
      25 –	See the Opinion of Advocate General Kokott in McCarthy (cited in footnote 15 above, paragraph 53).
      
      26 –	Trojani (cited in footnote 23 above, in particular point 36).
      
      27 –	Trojani (cited in footnote 23 above, in particular paragraphs 36 to 44); and similarly Martínez Sala (cited in footnote 24 above, in particular paragraphs 14 and 15 and 61 to 63).
      
      28 –	Trojani (cited in footnote 23 above, in particular paragraph 45).
      
      29 –	See point 63 of this Opinion.
      
      30 –	See point 97 of this Opinion.
      
      31 –	See the Commission’s statement of reasons concerning Article 14 of the original proposal (COM(2001) 257 final). 
      
      32 –	Ibid. 
      
      33 –	Lassal (see footnote 3 above, paragraph 37).
      
      34 –	See Lassal (cited in footnote 3 above, paragraph 55), referring to the statement of reasons of the Council in Common Position No 6/2004
         (cited in footnote 31 above) concerning the adoption of Directive 2004/38, in relation to Article 16 of that directive.
      
      35 –	Case 48/75 Royer [1976] ECR 497, paragraphs 31 to 51; Case C-459/99 MRAX [2002] ECR I‑6591, paragraph 74; and Case C-408/03 Commission v Belgium [2006] ECR I‑2647, paragraph 63. 
      
      36 –	See points 73 to 93 of this Opinion.
      
      37 –	Lassal (see footnote 3 above, paragraph 55).