PM Viktor Orban said Hungary would not allow migrants to leave its territory without registering.
His comments came as Hungarian authorities opened the main rail station in Budapest to hundreds of migrants after a two-day stand-off.
One train left, but then stopped near a migrant reception centre.
Migrants resisted efforts by police to get them off the train at Bicske, about 40km (25 miles) west of Budapest. Some were banging on the windows and shouting "Germany, Germany."
EU rules place responsibility for assessing asylum claims on the country where a migrant first arrives.
Many of the migrants currently in Hungary have been refusing to register there, in order to continue their journeys to Germany before seeking asylum.
The migrants stuck at Budapest's Keleti station were prevented from boarding trains on Tuesday and Wednesday. Some were involved in scuffles with police.
They had bought tickets after Hungary briefly appeared to abandon efforts to register migrants on Monday, allowing huge numbers to board trains to Vienna and southern Germany.
After the station opened on Thursday morning, rail staff said international trains were indefinitely suspended, but international tickets would be accepted on internal trains.
The number of migrants entering Europe has reached record levels, with 107,500 arriving in July alone. Germany expects to take in 800,000 migrants this year - four times last year's total.
The surge in numbers has created tension and disagreement over EU migration policy. Germany has been prepared to accept large numbers of asylum seekers, but other countries have not.
Mr Orban, who heads the anti-immigrant Fidesz party and was in Brussels for talks, said border control was "the number one issue".
"Hungarians are full of fear," he said. "People of Europe full of fear because they see that the European leaders, among them the prime ministers, are not able to control the situation."
During a tense press conference with European Parliament President Martin Schulz, the Hungarian leader said that "nobody would like to stay in Hungary, neither in Slovakia nor Poland nor Estonia.
"All of them would like to go to Germany," he said. "Our job is only to register them."
Mr Schulz countered: "What we are seeing for the time being is egoism instead of common European sense.
"To say 'yeah, you know we have refugees all over in Europe but they all want to go to Germany and therefore we are not concerned' is effective, but wrong. And therefore I think we need a fair and just distribution."
European Council president Donald Tusk said on Thursday that EU countries should accept at least 100,000 asylum seekers between them, a sharp increase on a previous European Commission target of 40,000.
EU states instead so far committed to sharing some 32,000 asylum seekers from Italy and Greece.
He also took Mr Orban to task for comments in which the Hungarian leader said his country was being "overrun" with refugees who threatened to undermine Europe's Christian roots.
Mr Tusk said: "Referring to Christianity in a public debate on migration must mean in the first place the readiness to show solidarity and sacrifice."
Jean Asselborn, Luxembourg's foreign minister, said all EU countries should have the capacity to absorb refugees.
"The EU's values must be valid through the union. No-one can say we don't want Muslims or blacks," he told German daily Sueddeutsche Zeitung.
The human cost of the crisis was also put into sharp focus on Wednesday when five children were among 12 migrants who drowned in Turkish waters while trying to reach Greece.
Images of the washed-up body of a three-year-old boy, who died alongside his mother and five-year-old brother, circulated widely on social media.