Boston Mayor Martin J. Walsh joined a growing chorus of U.S. leaders offering to accept some of the hundreds of thousands of refugees pouring out of war-torn areas in Africa and the Middle East.

“We would be willing to take migrants if they have them — that situation is still trying to figure itself out particularly in Europe,” Walsh told the Herald. “No one has contacted us about the migrants. We are waiting to see what happens and what the situation is.

“If we needed to, we would take them,” he added.

In an interview that aired yesterday on Herald Radio, GOP presidential hopeful Marco Rubio said he would be open to the United States housing some of the refugees flooding Europe, provided they were not connected to any terror organization.

Waves of asylum seekers have risked their lives to escape conflicts particularly in Syria and northern Africa. The influx of refugees has strained European countries’ abilities to deal with the demand.

The U.N.’s High Commissioner for Refugees Antonio Guterres accused the entire European Union yesterday of failing to see the crisis coming or take coordinated action.

“Europe is not organized to deal with it, because the European asylum system has been extremely dysfunctional and in recent weeks completely chaotic,” he said.

Officials expect 42,000 asylum seekers to arrive in Hungary in the next 10 days alone, and leaders of the U.N. refugee agency warn that the country needs international help to provide shelter on its border.

“We need better coordination to make sure we don’t have chaos at the border,” said Vincent Cochtel, the UNHCR’s refugee coordinator for Europe.

Germany expects to take in 800,000 this year, and government officials there said yesterday it could take another 1 million over the next two years.

Poland, the largest of the EU’s eastern members, has agreed to accept 2,000 refugees, saying it has too many economic problems to take more. In addition, officials have said that as a predominantly Roman Catholic country, Poland would have trouble integrating Muslims.

Austrian Chancellor Werner Faymann said countries opposed to taking in refugees under an EU-wide quota system plan backed by Germany and France should suffer financial penalties.

Peter Sutherland, the U.N. special representative on international migration, said too many countries wanted to give financial aid but no places for refugees to live.

Herald wire services were used in this report.