But writing in the Guardian, Mr Clegg said such a policy would risk turning young people into hardened criminals.

Image:The stabbing of teacher Ann Maguire has put knife crime in the headlines

It comes after Conservative Justice Secretary Chris Grayling said offenders caught twice with a knife should automatically receive a six-month prison sentence.

He wants the mandatory sentences included in an amendment to the Criminal Justice and Courts Bill next week.

Mr Clegg wrote in the Guardian: "When someone is caught carrying a knife, we need to do something about it. But six months in prison is not always the right answer.

"Imagine a vulnerable young girl hanging around with members of a gang. She could be forced into carrying a knife by another gang member - it happens a lot.

"When stopped by the police, she doesn't mention that she was forced to carry the knife, fearing retribution from the gang.

"Putting someone like that into prison could push them into the arms of hardened criminals, and let the gang leaders off the hook. Instead of prison, we need to divert vulnerable young people away from gang culture."

He said decisions on sentencing should be left to judges.

"This is why I believe this proposed law would be a step backwards," he writes.

Video:Clegg Plays Down Knife Crime Row

"It would undermine the Government's progress in establishing a rehabilitation revolution and reducing crime. We need to treat knife crime very seriously by letting judges choose the sentence to fit the crime.

"Turning the young offenders of today into the hardened criminals of tomorrow is not the answer."

England and Wales' most senior judge, Lord Chief Justice Lord Thomas, has also called for an urgent review of sentencing for youths carrying knives, saying it was a "major problem" among 12 to 14-year-olds.

"So I support the idea of a minimum sentence. It sends a very clear message to people who carry knives: Don't carry them.

"It's the casual carrying of knives that eventually may lead to a murder."

Video:Tackling Knife Crime 'Scourge'

And Labour leader Ed Miliband told Sky News he did not agree with Mr Clegg on the issue.

"I do think we need to see tougher penalties on knife crime," he said.

"I think that's what the public believe and I think we need to send a strong signal about the unacceptability of knife crime. That's why we're sympathetic to the idea that after being convicted of a second offence, there should be a mandatory minimum sentence."