Former Libertines frontman Pete Doherty has been given a suspended four month jail sentence after admitting possession of a flick knife.
Pete Doherty parted company with The Libertines earlier this year
The singer was found with the weapon by police as he drove to his home in Stepney, east London, on 18 June.
Doherty, 25, said outside Thames Magistrates' Court: "Justice was done and I am grateful for all the love."
He served two months in jail in 2003 after being found guilty of burglary at bandmate Carl Barat's home.
The singer, who has battled against drug addiction, arrived at court standing up through the sunroof of a Rover car.
Wearing a pork pie hat, he played a guitar as the car stood in stationary traffic.
A dozen fans surrounded the vehicle and, when asked how he felt, Doherty
said: "Innocent. What about the Magna Carta, did she die in vain?"
Doherty (right) was jailed for a burglary at Barat's home (left)
The court previously heard that Doherty said the four-inch knife was a present for a friend and that he had forgotten about it.
Defence lawyer Frank Brazell said there was no suggestion the knife was ever going to be used as a weapon and it was a "foolish, if you like almost romantic, mistake" to give it as a gift.
"He is not someone with a history of violence. Those who know him well say he
is quite the opposite, a peaceful man who pretty much abhors violence."
On Wednesday district judge Malcolm Read described Doherty as a "highly
intelligent young man" and a "very successful person".
He added: "Yet in June this year you brought back from holiday an item that
is an offensive weapon only made for one reason.
"It is a vicious looking item and you were well aware it was a dangerous item
as you broke the tip off."
He told Doherty that custody was the only sentence for such an offence, but he said he suspended the prison term for a year because of "exceptional circumstances" in the singer's life.
Mr Read added: "You have a position in your community which you should bear
in mind at all times."
The singer parted company with The Libertines, who have had five Top 40 hits in the UK, earlier this year.
The band's second album, called The Libertines, was released this week. Doherty now has a new band called Babyshambles.