Hungarian authorities have introduced new tougher laws to stop the entry of illegal migrants, the media reported on Tuesday.
Police can now detain anyone who tries to breach a razor-wire fence built on the border with Serbia, BBC reported.
From now on anyone who crosses the border illegally will face criminal charges, and 30 judges have been put on standby to try potential offenders.
Police also sealed a railway crossing point that had been used by tens of thousands of migrants, and many slept out in the open on the Serbian side of the border.
The laws also make it a criminal offence - punishable by prison or deportation - to damage the newly-built four-metre (13ft) fence along Hungary's 175km border with Serbia.
Also Read
Mounted police have been deployed along the border.
Police buses will now take asylum applicants to registration centres, but if their applications are refused they will now be returned to Serbia rather than being given passage through Hungary.
"We will start a new era," government spokesman Zoltan Kovacs said shortly after midnight after the fence was built.
"We will stop the inflow of illegal migrants over our green borders."
"That also means that the official and legal ways to come to Hungary and, therefore, to the European Union remain open. That's all we ask from all migrants - that they should comply with international and European law," he added.
Hungarian authorities said more than 9,000 refugees - a new record - crossed into the country before the border was closed on Monday.