COPENHAGEN -- Denmark and Sweden tightened border checks on Monday to stem the flow of migrants coming in from Germany, dealing fresh blows to the vision of a Europe without national boundaries.

As of midnight Sunday, Sweden demanded that all passengers travelling by train from Denmark show ID, something that hasn't been required since the 1950s.

Within hours, the Danish government announced it was stepping up controls of its border with Germany, to make sure that migrants headed for Sweden don't get stuck in Denmark.

"The government doesn't want Denmark to become a new big destination for refugees," Prime Minister Lars Loekke Rasmussen said.

The moves were the latest by European Union countries to suspend an agreement to keep internal borders open after 1 million migrants entered the 28-nation bloc in 2015, most of them by crossing the Mediterranean to Greece or Italy.

Loekke Rasmussen said if the EU can't protect its external border "you will see more and more countries forced to introduce temporary border controls."

Refugee rights advocates warned of a domino effect, with European countries tightening their borders one by one and cutting off the main migrant routes through Europe.

When the new Swedish rules were announced last month, the U.N. High Commissioner for Refugees said they "could have the effect of preventing individuals from exercising the right to seek asylum."

To comply with the new rules, passengers on Monday had to show passports or European national ID cards to board trains departing from Copenhagen Airport to Sweden across a bridge-and-tunnel link. The move was meant to deter migrants, many of whom don't carry travel documents.

The new rules appeared to have an immediate effect. Swedish police spokeswoman Ewa-Gun Westford said that by midday Monday only one asylum-seeker had arrived by train across the bridge. At the height of the migrant crisis a few months ago, more than 1,000 asylum-seekers crossed the bridge daily.

Some commuters said the ID checks were a hassle that would make their life more difficult and hinder efforts to deepen business and cultural ties between the Danish capital, Copenhagen, and cities in southern Sweden.

"Whether you are in Denmark or Sweden, it doesn't matter to the people here," said Richard Johansson, a 29-year-old Swede. "The people in our capital in Stockholm, they don't realize that."

Danish officials have suggested Sweden should pay for the cost of the ID checks, carried out by train operators on the Danish side at an estimated daily cost of 1 million kroner ($145,000).

"Some of the cost is due to the ID control. Other costs are due to the loss of income, because we have a decreasing amount of passengers because of this," said Tony Bispeskov, a spokesman for Danish train operator DSB.

Denmark beefed up its border controls with Germany as of noon Monday (1100 GMT, 6 a.m. EST). The Danish prime minister said the move was necessary because the Swedish ID checks "could lead to more refugees and migrants being stopped on their journey northward, and therefore ending up with us in Denmark."

He said the Danish measures wouldn't be as far-reaching as the Swedish ones, entailing only "spot checks" on passengers on trains crossing the mainland border on the Jutland peninsula and on ferries arriving in the Danish ports of Gedser and Roedby. He said there would be no problem for "ordinary" Danes and Germans to cross the border.

"We are not talking about controlling everyone coming in from Germany," he said.

His centre-right government has taken a series of measures to discourage migrants from coming to Denmark, including a proposal to seize their jewelry to cover their expenses in the country.

Sweden's left-leaning government initially had a welcoming attitude to migrants, but reversed course after more than 160,000 Syrians, Iraqis, Afghans and others applied for asylum in 2015, the highest number in Europe except for Germany.

After the Danish border controls, German officials warned that Europe's system of passport-free travel across borders was at risk and called for a pan-European agreement on how to control the flow of migrants.

Interior Ministry spokesman Johannes Dimroth said Germany would carefully watch the Danish border controls to evaluate "whether and how this affects migration northward from Germany."

Germany introduced border controls of its own on the Austrian frontier in mid-September.

More than 190,000 migrants crossed the German-Danish border last year. About 13,000 applied for asylum in Denmark, while others travelled further north to Sweden, Norway and Finland, Loekke Rasmussen said.

Karl Ritter reported from Stockholm. Geir Moulson and Frank Jordans in Berlin contributed to this report.