More than 500 people have been evicted from a former university residence in the suburbs of Paris, believed to have become France's largest squat.
Some of those told to leave were upset at the loss of their home
Many of those forced to leave the building in the suburb of Cachan were said to be illegal immigrants.
The eviction, carried out by some 500 police, came after lethal fires hit poorly maintained buildings housing immigrants last year, killing dozens.
France's interior minister has taken a tough stance on illegal immigration.
Nicolas Sarkozy has called for curbs on immigration in France, and for tougher penalties, including more deportations, for those found to be in the country illegally.
According to the interior ministry, police removed 504 people from the building.
At least 49 people were arrested, police said, with a view to being deported, the interior ministry added.
Estimates varied over the number of people living in the building, but a government spokesman told the Reuters news agency the building had been emptied and could be prepared for demolition.
Local authorities prepared hotel rooms for about 200 of those evicted to be offered temporary accommodation.
Those found to be in France illegally could face deportation.
Local officials insisted the operation passed off smoothly.
"There were no clashes, there were no injuries, there was no blood," regional leader Bernard Tomasini told a news conference.
"Law enforcement personnel were very careful."
But the Education Without Borders network, an organisation that helps those threatened with deportation, said some residents did resist the calls to leave.
Some barricaded themselves in the building and threw possessions out of the windows, while upset children cried throughout the operation, spokesman Pablo Krasnopolsky told the Associated Press.
According to local officials, improvised electrical wiring within the building had made it unsafe and increased fire risks.
Three deadly fires in hostels in central Paris during 2005 claimed at least 48 lives, including many children.
The deaths prompted Mr Sarkozy to insist that crowded residences often frequented by illegal immigrants should be cleared out and shut down.