French President Emmanuel Macron's government is in crisis after opposition parties united to defeat a key immigration bill.
MPs from the far right, far left and moderate parties voted on Monday to reject the draft law.
The left argued its measures were too repressive, while the right said they were not tough enough.
Following the defeat, Interior Minister Gérald Darmanin offered to step down.
Viewed as a hardliner on immigration issues, he had strongly supported the draft law. However, Mr Macron rejected his resignation.
The government argued the bill would both control immigration and better integrate migrants.
The bill would have made it easier for the government to expel migrants who are sentenced to prison sentences of five years or longer and would have made it more difficult for migrants to bring family members to France.
It was, however, significantly more lenient than a draft proposed by the Senate, the upper house of parliament dominated by the right, which would have severely reduced access to healthcare and benefits for migrants.
Before the vote, Mr Darmanin said on X (formerly Twitter) that, if passed, the bill would allow the government to deport "very dangerous" foreign nationals, including drug dealers.
But his efforts to convince opposition MPs to back him failed when disparate factions voted for a motion to reject the bill. MPs from the far-right National Rally joined those from the far-left France Unbowed, the right-wing Republicans and smaller parties to defeat the government by 270 votes to 265.
Before the vote, Arthur Delaporte, an MP for the Socialist party, said his party would vote against the bill as it was "unjust, scandalous and a threat to freedom".
Mr Macron's centrist Renaissance party lost its a majority in parliament in elections in June 2022. Since then, the government has frequently found itself unable to win votes in parliament.
The government has said it will now seek to redraft the bill. A measure used by Prime Minister Élisabeth Borne to pass laws without a vote cannot be used to clear this version.