A man had to undergo emergency surgery after being stabbed in the stomach during a drunken dispute, a court heard.
Said Ahmed, 20, avoided an immediate prison sentence after the court heard he armed himself with the weapon after being threatened with violence and racially abused.
Leeds Crown Court heard the incident happened after Ahmed and his friend had been invited back to a woman’s flat during a night out in Wakefield city centre.
Stephanie Hancock, prosecuting, said the woman’s friend then turn up at her flat and she feared he would become violent.
She told Ahmed and his friend to hide under the sofa.
The man was then allowed into the flat but became aggressive.
The court heard he shouted racial abuse and threatened to kick Ahmed. Ahmed picked up the weapon from the kitchen before going outside to call a taxi.
He went back into the flat as his friend had fallen asleep and tried to wake him.
Miss Hancock said the other man then became aggressive and Ahmed stabbed him once to the stomach.
Ahmed, of Highbridge Lane, Skelmanthorpe, Huddersfield, pleaded guilty to unlawful wounding. Laura McBride, mitigating, said Ahmed had picked up the weapon in self defence.
Ahmed was given a 10 month prison sentence, suspended for two years, and ordered to take part in a programme to address his offending.
Judge Geoffrey Marson, QC, said: “You know that this is a serious matter but you were subjected to a lot of provocation and threats and racial abuse. You acted with an excess of self defence.”