Germany has jumped 10 slots from last year to fifth place on a list ranking how well rich countries' policies help improve lives in the developing world, mainly thanks to its willingness to take in refugees - a hot topic in its Sept. 24 election.
Denmark took over the top spot from Finland, which falls to third place, while Sweden moves up one notch to second on the list that includes the impact from foreign aid and policies on trade, finance, migration, the environment and technology.
"Germany moves up to fifth on the 2017 Index, mainly thanks to policies on migration, including accepting a large number of refugees," author Ian Mitchell from the Washington-based Center for Global Development said in the report.
Labour mobility is potentially the most powerful tool for poverty reduction and income redistribution, he said.
"By migrating to richer countries, workers gain valuable skills and broaden their opportunities to earn higher incomes. They also send billions of dollars back home each year in remittances, a flow that surpasses foreign aid several fold."
Chancellor Angela Merkel's 2015 decision to open Germany's borders to hundreds of thousands of refugees, many fleeing war in the Middle East, cost her support but she has since bounced back.
Her challenger in this month's election, Social Democrat Martin Schulz, attacked her on Sunday for failing to coordinate a better European response to the refugee crisis.
The report said Germany's surge in the rankings was thanks not only to taking in the large influx, but also to its aid and trade policies.
Despite Germany's improvement, France still ranks highest among the G7 countries at fourth place.
The United States fell to 23rd from 20th among the 27 countries ranked. Its best performance was on trade and security, while it scored poorly on finance, environment, and aid, the report said.
"The U.S. withdrawal from the Paris Climate Accord will be reflected in future years, potentially taking the U.S. score lower," the think tank said.
Britain, which is in the process of negotiating its departure from the European Union, jumped to seventh place from ninth last year.
The report said there was a risk that Brexit could hit Britain's score on trade unless it could quickly replicate favourable EU trade policies towards developing countries. However, "on agriculture, it could certainly reduce subsidies compared with the EU and level the playing field for developing world producers."
The 2017 rankings show almost all countries improved their performance in the environmental component, with reductions in greenhouse gas emissions and new climate commitments in the 2016 Paris agreement.