Squatters will face up to six months in prison and so-called squatters' rights scrapped as it becomes a criminal offence in England and Wales tomorrow.
Ministers said the move would shut the door on squatters once and for all and help protect hard-working homeowners.
But campaigners warned that criminalising squatting in residential buildings would lead to an increase in some of the most vulnerable homeless people sleeping rough.
The introduction of the offence - which will carry a maximum sentence of up to six months in jail for persistent offenders, a £5,000 fine or both - follows a Government consultation on the issue last summer.
Phil Bayles reports:
But homeless charity Crisis said the new law would criminalise vulnerable people, leaving them in prison or facing a fine they cannot pay.
"It also misses the point," Leslie Morphy, the charity's chief executive, said.
"There was already legal provision that police and councils could, and should, have used to remove individuals in the rare instances of squatting in someone's home.
"And the new law also applies to empty homes - of which there are 720,000 in England alone, including many that are dilapidated and abandoned - criminalising homeless people when they are just trying to find a place off the streets."
She went on: "It will do nothing to address the underlying reasons why vulnerable people squat in the first place - their homelessness and a lack of affordable housing.
"Ultimately the Government needs to tackle why homeless people squat in the first place by helping not punishing them."
But justice minister Crispin Blunt said: "For too long, squatters have had the justice system on the run and have caused homeowners untold misery in eviction, repair and clean-up costs.
"Not any more."
Here's a look back at the Squatters stories we've covered on London Tonight:
Squatters have moved in to numbers 94 and 95 Park Lane. The group moved into the £30 million properties before Christmas. They claim the buildings have been empty for two years. But neighbours are furious:
Squatters who took over a family's home in north London just as builders had completed a renovation have now left the property peacefully.
Julian and Samantha Mosedale, and their three young children, had been left homeless, while the Romanian squatters staved off attempts to shift them from the house in Tottenham.
The squatters, who had children with them, claimed to have a tenancy agreement with a landlord which the police accepted:
A pensioner has told 'London Tonight' he felt 'shaken and ill' to find squatters had moved into his home when he had left it empty for just two days.
On return to his house in Barking, George Pope found that not only had a family moved in, they had changed the locks. The same thing has also happened to his neighbour:
Squatters are occupying a £10 million house in Highate:
A woman from Leytonstone went away last weekend to see her parents and go to the Proms.
But Julia High never actually enjoyed her evening of classical music.
Instead, she had a phone call telling her that in the hours she'd been away from her home, another family had moved in. They ate her food, drank her wine and took her possessions.
When Julia knocked on her own front door she noticed the women were even wearing her clothes: