The new measures include three-year jail terms for people climbing over the newly built razor wire fence on the border with Serbia, as well as new border "transit zones" to hold asylum seekers while their applications are being processed.
Lawmakers also declared a "state of crisis caused by mass immigration", which allows the police and army to assist in registering asylum-applications and operate detention facilities in registration camps.
Read: UN calls for up to 200,000 refugees to be shared among EU states
"If we do not protect our borders, tens of millions of migrants will keep coming to Europe," right-wing Prime Minister Viktor Orban said in a statement on Friday.
"If we allow everyone in, that is the end of Europe. We may one morning wake up and realise that we are in the minority on our own continent."
The legislation changes came as more than 1,000 migrants stranded for days in makeshift camps at Budapest's main train station set off on foot to the Austrian border, some 175 kilometres (110 miles) from the Hungarian capital.
Read: Muslims converting to Christianity in Germany to get asylum
Meanwhile, another 500 have been involved in a 24-hour stand-off with police in the town of Bisce, where they refuse to leave a train and be taken to a nearby refugee camp.
Hungary has in recent months joined Italy and Greece as a "frontline" state in Europe's migrant crisis, with 50,000 people trekking up the western Balkans and entering the country in August alone.
A record 3,300 migrants crossed into Hungary on Thursday, according to the latest figures from the UN refugee agency.
The government responded to the influx by erecting a barrier along its 175-kilometre (110-mile) border with Serbia.
COMMENTS (2)
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ