Croatia has closed seven of its eight road border crossings with Serbia following a huge influx of migrants.
Officials said they had no choice after more than 13,000 people entered the country since Hungary fenced off its border with Serbia earlier this week.
Many have been taken by bus to reception centres but some say they plan to walk to neighbouring Slovenia.
Huge numbers of people heading north from the Mediterranean have created a political crisis in the European Union.
Croatian officials said roads leading to the border crossings had also been shut.
The crossing on the main road linking Belgrade and Zagreb — at Bajakovo — appeared to be the only one left open.
Local media reported severe congestion at the crossing, with a 6km queue of lorries back into Serbia.
In other developments:
A migrant thought to be Syrian is electrocuted at the entrance to the Eurotunnel in Calais
Hungarian Prime Minister Viktor Orban says Hungary has started building a fence along part of its border with Croatia, after media reports that migrants were crossing it
German Foreign Minister Frank-Walter Steinmeier says EU members reluctant to accept migrant quotas might have to be overruled with a majority vote at a summit on 23 September
Analysis: Guy Delauney, BBC News, Zagreb
Freedom of movement is disappearing in south-east Europe. Slovenia has suspended rail connections with Croatia after around 150 refugees arrived by train. And Croatia has now joined Hungary in closing most of its road borders with Serbia.
The authorities in Zagreb say they had no choice. More than 11,000 refugees have entered the country since Wednesday — the day after Hungary criminalised unofficial border crossings.
Croatia has attempted to take the newcomers to asylum centres — but the overwhelming numbers mean that many people have been left on the streets.
Some have told the BBC they plan to walk north to neighbouring Slovenia which is in the EU's border-free Schengen Area.
On Thursday, Croatian Interior Minister Ranko Ostojic said his country was "absolutely full".
He said his message to the migrants was: "Don't come here any more. Stay in refugee centres in Serbia and Macedonia and Greece. This is not the road to Europe. Buses can't take you there. It's a lie."
But a Reuters journalist at the scene reported that migrants were walking through fields to bypass one of the border crossings.
Scuffles broke out in two locations on the border with Serbia on Thursday after people were left waiting for hours for transport further north.
Crowds briefly broke through police lines at Tovarnik and Batina — two of the crossings now closed.
The BBC's Lyse Doucet, at Tovarnik, said buses arrived just before midnight but not enough to transport everyone. Drivers said people were being taken to a reception centre.
But many appear to have slipped away to continue their journey north on foot.
One man, a Syrian from Homs called Hanny, told the BBC that people were walking without sleep.
"There's no time. The rules change every day," he said.
It was Hungary's decision to seal its border with Serbia that triggered the move by thousands of migrants, who had travelled to Serbia via Macedonia and Greece, to try to reach Western Europe via Croatia instead.
Images of Hungarian police trying to disperse people with tear gas and water cannon have been criticised by the United Nations' top human rights official.
Late on Thursday, Slovenian police said they had stopped a train carrying asylum seekers at Dobova on the border with Croatia.
Police tried to take the migrants back to Croatia, but the Slovenian Press Agency reported that the Croatian authorities had refused to take them.
Rail traffic between the two countries is now suspended until at least Friday evening, it added.
The crisis has challenged the Schengen agreement, with Germany, Austria and Slovakia all re-imposing checks on parts of their borders.
EU regulations dictate the refugees must register and claim asylum in the first member state they reach. But many migrants and refugees wish to continue on to Germany and Austria, and do not wish to seek asylum in smaller, less well-off EU nations such as Hungary, Croatia and Slovenia.