Migration is resurfacing as a hot topic in the election campaign for the new European Parliament after sowing discord across the EU throughout the outgoing legislature's five-year term.
According to Eurostat, around 7.5% of the more than 510 million people in the EU 28-nation bloc did not hold the citizenship of the country where they lived, as of January 1st, 2017, as reported by AFP.
Among them were 21.6 million people, or 4.2% of the whole bloc, who had the nationality of a non-EU country, according to the European statistics office. Some 16.9 million were citizens of another EU country.
Germany led the way in welcoming non-nationals, with 9.2 million people, followed by the United Kingdom with 6.1 million, Italy five million and France 4.6 million.
Luxembourg accounted for the highest proportion of foreigners who made up 48% of its population. Poland and Romania accounted for the least, at less than 0.6% each.
EU countries can grant residence permits to nationals of third countries to allow them to work, study or even receive asylum.
Some 3.1 million new permits were issued in 2017, according to Eurostat. Poland gave out the highest number, some 683,000, followed by Germany with 535,000, Britain 517,000 and France, 250,000.
In 2017, Ukrainians received the highest number of third-country permits, at 662,000 -- ahead of Syrians, who received 223,000, and Chinese, who got 193,000.
In 2015, the EU experienced an unprecedented surge in migration via the Mediterranean Sea, most of them fleeing war and instability, particularly in Syria.
The UN's International Organization for Migration said there were more than one million, including more than 850,000 who entered Europe via Greece.
Some 56% of them came from Syria, 24% from Afghanistan and 10% from Iraq.
Total arrivals plunged again to 187,000 in 2017 and to 144,000 in 2018, when Spain became the main entry point to Europe with 65,000 crossing its borders.
For 2019 so far, the IOM recorded around 18,000 arrivals in the bloc from January until mid-April.
EU countries registered 580,000 new requests for asylum in 2018, who accounted for less than half of those filed during the 2015 historic peak, when 1.26 million arrived.
According to Eurostat, about 80,900, Syrians accounted for the largest number of people filing an initial request. Afghans came next with 41,000 and Iraqis came third at 39,600, ahead of Pakistanis, Iranians, Nigerians and Turks.
After the 2015 record, the number of first asylum requests in the EU remained about the same in 2016, at nearly 1.2 million, before starting to fall sharply in 2017.