The Czech Republic says it is stopping the practice of detaining Syrian migrants who have applied for asylum in Hungary.

The measure will significantly reduce the time the migrants need to reach Germany. Previously, Czech authorities placed such migrants in centers for 42 days.

Czech police spokeswoman Katerina Rendlova says the new move was prompted by Hungary's refusal to accept such migrants back and also by Germany's declaration not to return them.

Rendlova said Wednesday it makes no sense to detain them and authorities will only check their documents and let them go.

The Czech Republic is mostly used by migrants as a transit country on their way to Germany and other wealthier EU states.