It follows from the foregoing that levies, such as those made under the national legislation at issue in the main proceedings, in so far as they relate to income from real estate and to capital gains realised following the transfer of immovable property received in a Member State by a natural person who holds the nationality of that State but resides in a third country other than an EEA Member State or the Swiss Confederation, come within the concept of ‘movement of capital’ within the meaning of Article 63 TFEU.

With regard to the material scope of Article 63 TFEU, while the FEU Treaty does not define the concept of ‘movement of capital’, it is apparent from settled case-law of the Court that such movement within the meaning of that article includes investments in property within the territory of a Member State by non-residents (see, to that effect, judgments of 11 January 2001, Stefan, C‑464/98 , EU:C:2001:9 , paragraph 5 ; of 5 March 2002, Reisch and Others, C‑515/99, C‑519/99 to C‑524/99 and C‑526/99 to C‑540/99 , EU:C:2002:135 , paragraph 30 ; and of 8 September 2005, Blanckaert, C‑512/03 , EU:C:2005:516 , paragraph 35 ).

It follows that the territorial scope of the free movement of capital laid down in Article 63 TFEU is not limited to the movement of capital between Member States, but also extends to such movement between Member States and third countries.

First of all, it must be borne in mind that Article 63 TFEU gives effect to the free movement of capital, first, between Member States and, secondly, between Member States and third countries.

Articles 63 TFEU and 65 TFEU must be interpreted as not precluding legislation of a Member State, such as that at issue in the main proceedings, under which a national of that Member State who resides in a third country other than a Member State of the European Economic Area (EEA) or the Swiss Confederation and is affiliated to a social security scheme in that third country is subject, in that Member State, to levies on income from assets for the purpose of contributing to the social security scheme established by that Member State, whereas an EU national covered by a social security scheme of another Member State is exempted therefrom by reason of the principle that the legislation of a single Member State only is to apply in matters of social security pursuant to Article 11 of Regulation (EC) No 883/2004 of the European Parliament and of the Council of 29 April 2004 on the coordination of social security systems.

That principle that the legislation of a single Member State applies in matters of social security is designed, as regards EU nationals who move within the European Union, to avoid the complications which may ensue from the simultaneous application of a number of national legislative systems and to eliminate the unequal treatment which would be the consequence of a partial or total overlapping of the applicable legislation (see, to that effect, judgment of 26 February 2015, de Ruyter, C‑623/13, EU:C:2015:123, paragraph 37 and the case-law cited).

It follows from the foregoing considerations that there is an objective difference between, on the one hand, the situation of a national of the Member State concerned who resides in a third country other than an EEA Member State or the Swiss Confederation and is affiliated to a social security scheme in that third country and, on the other hand, the situation of an EU national affiliated to a social security scheme of another Member State, in so far as that latter national alone is liable to benefit from the principle that the legislation of a single Member State only is to apply in matters of social security, as laid down by Article 11 of Regulation No 883/2004, by reason of his movement within the European Union.

It follows that national legislation such as that at issue in the main proceedings may be justified, having regard to Article 65(1)(a) TFEU, by the objective difference in situation which exists between a natural person who is a national of a Member State but resides in a third country, other than an EEA Member State or the Swiss Confederation, and is affiliated to a social security scheme in that third country and an EU national residing and affiliated to a social security scheme in another Member State.

However, since the FEU Treaty does not contain any provision extending the free movement of workers to persons who migrate to a third country, it is important to ensure that the interpretation of Article 63(1) TFEU as regards relations with third countries, other than the EEA Member States or the Swiss Confederation, does not enable persons who do not come within the territorial scope of the free movement of workers to profit from that freedom (see, to that effect, judgment of 13 November 2012, Test Claimants in the FII Group Litigation, C‑35/11, EU:C:2012:707, paragraph 100).

(see paras 41, 42, 44, 46, 47, operative part)