BUDAPEST—Hungary has finished building a fence along its border with Croatia and may shut migrants out this week, a move that would force the thousands of asylum seekers from the Middle East and Afghanistan entering Hungary each day to seek a new route to Germany and Northern Europe.

“Hungary is ready to close off its border with Croatia within an hour,” Hungarian Prime Minister Viktor Orban said in Brussels on Thursday when heading into a meeting of EU heads of states and governments on the migrant crisis.

Mr....