The Hungarian parliament has passed a law which aims to clear several thousand homeless people off the streets of Budapest and other towns.
The government says the law is designed to help the homeless, and that there are enough places in homeless shelters.
But critics deny that, and say the law criminalises the homeless, who could face community work, fines or even imprisonment.
The law is due to come into force next week.
Those caught sleeping rough in urban areas can be sentenced to community service or a fine, if they either refuse to move on when requested to, or are caught in the same area again.
Those who live in shacks in the woods are especially alarmed by one provision in the new law, which allows for those who build such structures without permission to be imprisoned.
Several hundred protesters gathered outside parliament when the law was passed on Monday evening.
"Homeless people have always been harassed by the authorities," says Tessa Udvarhelyi, an activist of The City Belongs to Everyone, a civic group in Budapest.
"The difference is that this government… is codifying the fact that homeless people are stigmatised, harassed and criminalised."
She estimates that 10,000 people live on the streets of the capital, or in shacks they have built for themselves in the forests on the outskirts.
There are just under 6,000 places in hostels in the Hungarian capital. She says they are overflowing, especially in winter, leaving another 4,000 people to fend for themselves.
These figures are fiercely disputed by the government.
"There are plenty of places for daytime, and for night-time shelter," says Ferenc Kumin, a spokesman for the right-wing government of Prime Minister Viktor Orban.
"We believe that [they are] almost 100% covered."
The question is becoming especially acute as an Indian summer turns into the first cold days of autumn.
The new law is actually an amendment to a 2012 law on "misdemeanours", which came into force but was then struck down by the Constitutional Court, only to be embedded in an amendment to the constitution passed in March this year.
The Fidesz party came to power on a tough "law and order" ticket, and some local Fidesz mayors in the capital have led the way in proposing a crackdown on the homeless.
The government has introduced a number of measures, from new hostels to a "heated streets" project, designed for the drunk and mentally disturbed who might not get a place in a normal shelter. There are also some places for couples and those with children.
But the demonstrators complain that most hostels offer little privacy, and take them away from the survival networks they build up in certain parts of the city - people who regularly bring them food, or money.
"I live in a tent in the outskirts. All I ask, from this or any government, is the chance to live decently," said Betti Fetter, 50, who has lived on the streets of Budapest for 23 years.