ROME (Reuters) - Countries should face financial consequences for refusing to share the burden of housing refugees arriving in Europe, the Social Democrat candidate for German chancellor said during a trip to Italy on Thursday.

Germany's Social Democratic Party candidate for chancellor Martin Schulz talks during a news conference at Chigi Palace in Rome, Italy, July 27, 2017. REUTERS/Max Rossi

Speaking after a meeting with Italian Prime Minister Paolo Gentiloni, Social Democrat leader Martin Schulz said Europe needed to move towards a system of managed, legal immigration to the continent in order to counter the desperation that was leading thousands to risk their lives to reach Europe.

“Canada has legal immigration, the United States has it, Latin America, Australia and New Zealand - they all have immigration rules,” he said. “That means you don’t have a guarantee, but you have hope.”

With Germany’s economy booming and unemployment falling to record lows, a campaign focusing on the ills of inequality has struggled to gain traction against Chancellor Angela Merkel, who is seeking a fourth term in office in a Sept. 24 election.

On Sunday Schulz, whose SPD is lagging far behind Merkel’s conservatives in the polls, said Germany needs to take action to prevent a re-run of 2015, when some 890,000 migrants arrived in the country.

The Rome trip, followed by a visit to a refugee reception center in Sicily, is designed to help the former European Parliament president burnish his statesmanly credentials while highlighting the migration crisis, which initially cost Merkel support, though she has since rebounded in the polls.

Italy has reported growing numbers of refugees arriving on its coasts after perilous crossings of the Mediterranean, and Schulz said all European Union countries should help it and other countries with external borders to shoulder the burden.

“The EU’s seven-year budget cannot be understood on the basis that net financial contributors should deal with migration alone, while other countries receive money very happily but then refuse to help with the migration problem,” he said.

Several poorer eastern members of the EU, Hungary and Poland among them, have repeatedly opposed efforts to distribute asylum seekers around the 28-member bloc.

The largest contributor to the EU budget, Germany took in more than a million refugees fleeing war and poverty in the Middle East and Africa in 2015 and 2016, transforming the country’s demographics overnight and briefly imperiling Merkel’s chancellorship.