Nearly 100 MPs - many Tory - voted to give ministers rather than judges the final say over whether deportation would breach the human rights of foreign criminals.
But Conservative backbencher Dominic Raab's amendment to the Immigration Bill was defeated by 241 votes to 97, a Government majority of 144.
Yet the amendment only failed due to opposition from Labour and Liberal Democrat MPs, thus splitting the Coalition. A LibDem source made clear it was "illegal and counterproductive".
The Prime Minister, facing a massive rebellion, decided to retreat and ordered his Tory ministers to abstain.
Labour accused the PM of being afraid of his own backbenchers and denounced the Government bill as a "complete car crash".
In the Commons, Theresa May, the Home Secretary, explained it was "absolutely clear" Mr Raab's amendment was "incompatible with the European Convention on Human Rights".
But No 10 sources made clear Mr Cameron had a "very great deal of sympathy" with it but did not want to ask Tory MPs to vote against it.
Under the Bill, the Coalition wants to oblige judges to take into account factors in favour of deporting a criminal. Yet Mr Raab argued this change would still mean too much discretion for judges to allow those who wanted to stay in the UK to claim a right to a family life.
The SNP condemned the bill as "typical of the UK government's Ukip-inspired agenda".
Pete Wishart, the Nationalist backbencher, said it was "unbelievable that an amendment has been passed, allowing the UK Government to remove citizenship even when that would leave the citizen stateless".
Business Secretary Vince Cable accused the Tories of being "panicked by the Ukip phenomenon" and undermining efforts to reassure the public on immigration.