A new legal regulation has come into force in Hungary making homelessness punishable by a fine of around $600 (£384) or prison.
MPs from the ruling conservative party proposed the regulation, on the grounds that Budapest could not cope with the large number of people on the streets.
Critics, including charities for the homeless, say it is unenforceable and that hostels lack sufficient places.
The Hungarian capital is said to have some 10,000 homeless people.
According to an amendment to the local government act, passed by a strong majority in parliament last month, those found sleeping on the streets will first receive a warning.
They can subsequently be imprisoned or ordered to pay the fine.
'Stretched to the limits'
The move has provoked widespread criticism, including from Hungary's human rights ombudsman, the BBC's Nick Thorpe reports.
Miklos Vecsei, deputy head of the Hungarian Maltese Charity Service, said the law had not been passed on the basis of any rational or professional criteria but because the public were fed up with the homeless.
Budapest's capacity had been stretched to the limits but deep poverty needed to be cured, not banned, he argued.
The author of the law, Mate Kocsis, is an MP from the ruling Fidesz party and a district mayor in the city.
He argues that local councils should take responsibility for tackling homelessness, and points to new schemes and places in homeless hostels.
Homeless charities argue that this will still leave between 1,000 and 3,000 homeless people without shelter.
A series of demonstrations against the new law is planned.