Award-winning grime rapper J Hus has been jailed for eight months after carrying a 10cm knife outside a major London shopping centre.
The musician, who appeared in court under his real name Momodou Jallow, apologised and said he regretted his "utterly stupid" actions.
The rapper won best song at the MOBO Awards in 2017 and was nominated for the Mercury Music Prize the same year.
Jallow, 23, was carrying the folding knife near Westfield in Stratford, east London, on 21 June.
He initially pleaded not guilty to possession of a blade in a public place but changed his plea at a further hearing in October.
Snaresbrook Crown Court heard he has six convictions for 10 offences.
Judge Sheelagh Canavan told him: "You are role model to many, yet you have failed to leave your past behind you."
She added: "This, in such a young life, is the fourth occasion when you have gone out armed in public with a knife."
In a letter read to the court by his barrister Henry Blaxland QC, the rapper said: "My decision to carry a weapon was careless, ill-advised and utterly stupid.
"Being a public figure that many look up to, I simply should have known better."
He said he had not been in his "right state of mind" and spoke of the effect the stabbing of a close friend days earlier had had on him.
He added: "I am in no way trying to justify my actions as they are unjustifiable.
"I am deeply sorry, I regret my foolish actions."
Jallow had been sitting in his Audi with a female at the wheel and another passenger when they were stopped by police outside the Westfield centre.
Helen Owen, prosecuting, said there was a smell of cannabis from the vehicle and when asked by an officer if he had anything on him, the star said he had a knife in his pocket.
When asked why he was carrying the blade, the court heard he replied: "You know, it's Westfield."
Jallow's friend had been knifed and paralysed in the area just days earlier and the rapper, who was himself stabbed in 2015, said he had fears he would be the victim of another attack.
Mrs Canavan said that while she accepted Jallow had been shopping and was not trying to provoke a response to the attack on his friend by returning to Stratford, he must have been aware of the risks.
More from UK
The court also made a criminal behaviour order banning Jallow from entering or travelling through Newham borough for the next three years and from associating with a number of named individuals.
New figures show the number of criminals being caught with knives or dangerous weapons is at the highest level since the start of the decade.