Liberal Democrats MPs were left isolated on Tuesday after the House of Commons voted by 404 to 53 to support mandatory jail sentences for anyone caught twice in possession of a knife.

The result was the first time in the coalition government that Labour and Conservatives have united against the Lib Dems. It also marks another moment in the breach of collective coalition responsibility, but is unlikely to mark a serious long-term breakdown before the 2015 general election.

Conservative ministers were instructed to abstain but others in the party were given a free vote, allowing the vast majority to back the mandatory sentence measure tabled by the Tory backbencher Nick de Bois.

Labour MPs, aware of public opinion over knife crime, supported the amendment, reassured that it still gives judges some discretion on the length of a sentence.

Before last month's local elections, the issue became the subject of controversy when letters from Lib Dem cabinet ministers objecting to the proposals were leaked in what was seen as a breach of ministerial confidentiality.

The Lib Dem leader, Nick Clegg, decided to take a stand, saying he believed the measure would have no practical effect on gang crime.

The justice secretary, Chris Grayling, now needs to find further prison places in Britain's overcrowded jails. The amendment, which is likely to cost £20m, imposes a minimum six-month jail term on a second conviction for carrying a knife and 16-year-olds will be given at least a four-month detaining and training order.

De Bois told MPs that existing sentences were too lenient, fuelled knife crime and did not do enough to attack the knife culture that blights young lives in London.

"For those that are actually embarking on a journey that embraces the knife culture, the eventual destination of this journey may be serious injury to someone else or even to the carrier of the knife and, frankly, it can lead to the death of someone. They may take a life," he said. "And that journey to destruction which quite simply ruins lives included picking up and carrying a knife for the first time.

"I believe our courts are dispensing sentences for possession of a knife in thousands of cases that are quite simply treated by offenders as little more than an occupational hazard.

Andy Slaughter, the shadow justice minister, backed the amendments, describing knife crime as one of the "most serious and intractable criminal justice issues – one that leaves irrevocable damage in its wake". He added: "Prevention is better than cure ... but it is important the message goes out from this house that carrying a knife without good reason is unacceptable."

He accused Clegg of trying to "buff his tarnished Liberal credentials" and a "cheap political stunt to throw a bone to his increasingly malnourished base" in terms of the timing of his opposition.

Sadiq Khan, the shadow justice secretary, said the government could not come to an agreed position on the issue because "it is no longer a coalition; it is disintegrating by the day".

But he said the proposal still gave judges powers to employ discretion. The Crown Prosecution Service and police will have complete discretion whether or not to charge someone with possession of a knife twice.

Khan said the amendment was not a panacea and more needed to be done to educate people that carrying a knife was unacceptable.

In one of the few speeches opposing the measure, Julian Huppert, Lib Dem MP for Cambridge, said there had been a substantial decline in knife possession offences over the past three years. He said the true choice was between doing the thing that sounds the toughest or trying to do the things that actually work.

Huppert said he believed more children aged 15 or under would be found carrying knives if De Bois's proposals were approved. "People in gangs who have been charged once with possessing a knife will simply react, if they pay any attention at all, and that will depend on the quality of policing," he said. "They will respond by making another more junior, more vulnerable gang member carry a knife for them."

The official sentencing guidelines for judges since 2008 have made clear that their "starting point for the lowest level of knife possession amongst adults should be 12 weeks' custody". So the effect of the new measure would be to double that starting point.

Official figures published last week showed that claims that three out of four repeat offenders were not jailed for carrying knives were wide of the mark. The justice ministry figures show that 43% of offenders with at least one previous conviction were immediately jailed in 2012-13; only 3% were given a caution. The average sentence for those jailed for possessing a knife is now 7.4 months.