Danish police will no longer try to stop migrants and refugees passing through the country to get to Sweden and other countries.

The move highlights how EU countries are struggling to uphold rules under which people fleeing war and persecution are supposed to apply for asylum in the first EU country they enter and not travel from one country to another.

The decision comes amid a surge of migrants and refugees arriving from Germany and refusing to apply for asylum in Denmark, saying they want to go Sweden, Finland or Norway instead.

Danish authorities initially insisted they must register in Denmark but changed their minds after hundreds of migrants demanded the right to cross the country.

"We can't detain foreigners who do not want to seek asylum (in Denmark)," Denmark's police chief Jens Henrik Hoejbjerg said. "Therefore, there is no other option than to let them go, and we cannot prevent them from travelling wherever they want."

In the Danish port city of Roedby, one of the two main crossings from Germany, migrants were seen being picked up by people in private cars.

Authorities said at least 3,200 migrants have entered Denmark since Sunday and about 400 have sought asylum.

Many migrants say they want to go on to Sweden, Norway or Finland, because they have relatives there or believe that conditions for asylum-seekers are better.

Danish railway company DSB said some train service between Germany and Denmark have resumed after being suspended the day before.

Meanwhile, thousands of people, including many families with young children, are braving torrential downpours to cross Greece's northern border with Macedonia.

Greek authorities have registered about 17,000 people on the island of Lesbos in the space of a few days, allowing them to continue their journey north into Europe.

Greece's caretaker government chartered two extra ferries and sent additional staff to Lesbos to speed up the registration and ease overcrowding on the island, where more than 20,000 refugees and migrants had been living after arriving on dinghies from the nearby Turkish coast.

About 7,000 people waited in the mud of an open field near the northern village of Idomeni to cross the Macedonian border, with more arriving in trains, buses and taxis.

Police in Austria say more than 3,000 migrants and refugees crossed into the country overnight at Nickelsdorf, the main border point with Hungary.

A train carrying 400 to 500 migrants left for Vienna early on Thursday but most remain at Nickelsdorf.