Hundreds of migrants seeking to reach Germany rushed trains at Hungary’s main international rail station on Thursday after police stopped manning the door, as Hungarian Prime Minister Viktor Orban blamed Europe’s migration crisis on Berlin.

German Chancellor Angela Merkel rejected the criticism, saying her country is doing what all European Union member states should be by taking in refugees in need of protection. Ms. Merkel said she agreed earlier in the day with French President François Hollande that the EU needs binding quotas to distribute refugees fairly.

Tensions have been rising within the bloc as it struggles to deal with thousands of migrants from the Middle East and Africa, underlining competing national interests amid warnings that the bloc’s cherished policy of border-free travel is at risk. Hungary—on the bloc’s edge—has emerged as a key transit point for people seeking to reach wealthier states where they believe they will have better prospects.

Mr. Orban took a defiant stance during a news conference at the European Parliament in Brussels, where he was holding a series of meetings with top officials. He said he was abiding by EU rules in seeking to register migrants before allowing them to pass into another EU country and is considering the deployment of the army to protect Hungary’s borders with non-EU member neighbor Serbia. He brushed off calls for Hungary to reconsider its rejection of a fairer redistribution system for refugees across the bloc.

“The problem is not European, it’s German. Nobody would like to stay in Hungary, neither Slovakia, Poland or Estonia,” Mr. Orban said after talks with European Parliament President Martin Schulz. “All of them would like to go to Germany.”