Mr Gates said his home country “had the capacity” to follow the examples of Germany and Sweden, who were “to be congratulated” for welcoming migrants.

But he acknowledged that relaxing immigration barriers “was not easy”.

Speaking at the World Economic Forum in Davos, Mr Gates added that governments were dealing with “tight budgets”.

However, he emphasised that the issue was largely a political one, and that “the total number of refugees is not a world record”.

The global elites in Davos this week have been concerned about the “fourth revolution” – the increased automation in some industries, which, the World Economic Forum has warned, “will cost millions of jobs and hit women hardest”.

Mr Gates added that technological advances are overwhelmingly a cause for celebration.

Why does Bill Gates think we should be happy in 2016?

“It’s amazing how many farming jobs we got rid of, he said. “The US feeds itself with less that 2% of the population. That’s really a very good thing.

“Until every old person is well taken care off, every handicapped kid has round the clock support, we can take labour and do great things with it.

“Anything that allows us to make the goods we’re making today with less labour, that just gives society more options.”

Although he cautioned that governments would need to retrain people, and soften the blows to various industries, Mr Gates, who has described himself as an “impatient optimist”, said that “innovation is on our side”.