A Swedish national flag flies from a boat moored in front of  historic buildings on the waterfront of the Riddarholmen islet in Stockholm. (Mikael Sjoberg/Bloomberg)

A new ranking of the best countries to be an immigrant has placed Sweden in the top spot, closely followed by Canada, Switzerland, Australia and Germany. The United States, a country which was largely founded through mass immigration, came in seventh.

U.S. News and World Report, which compiled the ranking, said it looked at measures such as economic stability, income equality and job markets to create its list, using a special survey of the opinions of more than 21,000 business leaders and other elites, as well as members of the public.

The ranking's authors say they also used data from the World Bank and the United Nations on migrant populations in different countries, as well as the amount of remittance sent back to their country of birth. The immigration project is part of a broader ranking, launched by U.S. News and World Report last year, that attempts to determine the world's “best” countries in the same way that the publication also ranks colleges, hospitals and cars.

Eric Gertler, co-chairman of U.S. News and the New York Daily News, said that the experience of creating the best countries ranking showed them that many people view immigration as the most important issue in the world.

“With the recent spotlight on immigration in the U.S. and abroad, we wanted to dive into its potential benefits and challenges on a country’s perceived economic status in the world,” Gertler said.

Specifically, immigration in Sweden became the subject of an unusual public debate in the U.S. this year, with President Trump suggesting at a rally in February that immigration had led to problems in Sweden and that the country should serve as a model for how the U.S. should not allow some immigrants in. “They took in large numbers and they are having problems like they never thought possible,” Trump said, sparking a flurry of angry responses from Swedes.

Sweden had become a popular destination for refugees from Africa and the Middle East over the past few years, taking in more per capita than any other European nation at the height of the migrant influx in 2015. Though the U.S. News ranking is not designed to look at refugee or asylum policy specifically, it does consider measures relevant to it.

“While our methodology did not focus on refugees specifically, it did take into account immigration policies and integration measures per analysis from the United Nations,” said Deidre McPhillips, a U.S. News data reporter who helped design the rankings. “Our aim with this package was to focus on the economic aspects of immigration and the impacts this could have on a country's perceived standing in the world.”

Sweden wasn't the only Nordic country to fare well — Norway, Finland and Denmark also took places in the top 10, largely due to favorable perceptions found in the survey about their economies and commitment to income equality. Other countries, such as Canada and Switzerland, were given positive marks not only for their economy but also integration measures for immigrants, such as language training.

While the U.S. scored well because of the large numbers of remittances, U.S. News said that the country fell in the rankings due to its perceived economic inequality. Britain ranked even lower — 17th — despite its strong economy, because its immigration policy specifically favored its own nationals. U.S. News noted that it was one of only six countries that had similar policies, including Saudi Arabia and Myanmar.

Generally, European and North American nations rank highest, though some European nations — most notably Serbia (68) and the Czech Republic (50) — ranked far lower. The highest-ranking Middle Eastern country was the United Arab Emirates at 15, while the highest-ranking Asian nation was Singapore at 18. Brazil is the highest-ranking country in South America at 32 and South Africa is the highest-ranking African nation at 45.

In total, 80 countries were included in the ranking. Kenya came bottom of the list, preceded by Guatemala and Tunisia.

The full ranking is below:

RANK COUNTRY
1 Sweden
2 Canada
3 Switzerland
4 Australia
5 Germany
6 Norway
7 United States
8 Netherlands
9 Finland
10 Denmark
11 Luxembourg
12 Austria
13 New Zealand
14 France
15 United Arab Emirates
16 Ireland
17 United Kingdom
18 Singapore
19 Italy
20 Japan
21 China
22 Spain
23 Qatar
24 Russia
25 South Korea
26 Portugal
27 Greece
28 Israel
29 Slovenia
30 Oman
31 Ukraine
32 Brazil
33 Saudi Arabia
34 Romania
35 Argentina
36 Panama
37 Bahrain
38 Belarus
39 Chile
40 Bulgaria
41 Mexico
42 Turkey
43 Poland
44 Uruguay
45 South Africa
46 Kazakhstan
47 Hungary
48 Croatia
49 Costa Rica
50 Czech Republic
51 Thailand
52 Indonesia
53 Lebanon
54 Morocco
55 Colombia
56 Latvia
57 Malaysia
58 Jordan
59 Philippines
60 Bolivia
61 Azerbaijan
62 Vietnam
63 Ecuador
64 Egypt
65 Nigeria
66 Angola
67 Algeria
68 Serbia
69 Iran
70 Dominican Republic
71 Sri Lanka
72 India
73 Peru
74 Burma (Myanmar)
75 Pakistan
76 Ghana
77 Tanzania
78 Tunisia
79 Guatemala
80 Kenya

More on WorldViews

Who is Nils Bildt? Swedish ‘national security adviser’ interviewed by Fox News is a mystery to Swedes

In a global ranking of ‘best countries,’ the United States drops to No. 7