Khalid Mokadeh, of The Oval, Firth Park is accused of murdering Sami Al-Saroori, 31, during an altercation outside a house party in Wensley Gardens, Firth Park just before midnight on September 9 last year.
During his closing speech at Sheffield Crown Court on Wednesday, Abbas Lakha QC, defending, told jurors that Mokadeh had acted in self defence when he stabbed Sami a single time.
Mr Lakha said that in the months leading up to Sami's death, Mokadeh had been stabbed in the arm by people looking for Sami Al-Saroori's brother, Mohammed, and had been shot - in an attack he believed had been ordered by Sami .
Mr Lakha added: "Might it be that he genuinely feared what might happen to him, because of everything that had happened, not just on that night, but the events leading up to that night.
"Might it be when he was grabbed in that way, forcefully - finger marks were left on his arm - that he thought: 'Oh my God, last time I got shot, the same might happen again."
Mr Lakha told jurors that if they believed a fear of being attacked is what motivated Mokadeh to stab Sami that they must return a verdict of not guilty.
Mokadeh was also standing trial for the additional charges of wounding with intent and possession of a bladed article, relating to an incident on May 25 last year when Mohammed Al-Saroori was stabbed in the street.
But three weeks into the trial, Mokadeh admitted to stabbing Mohammed and changed his plea to guilty for those charges when the prosecution concluded their evidence last week.
"There's no doubt that Khalid Mokadeh himself has lied, he has admitted he lied," said Mr Lakha, adding: "It wasn't until just before Mohammed gave evidence that Khalid Mokadeh accepted that it was him, Khalid, that had been responsible for the stabbing."
He continued: "He said he was worried that if he told you the truth, that he was responsible for stabbing Mohammed, that he intended to do it, you might not believe him when he told you what happened with Sami was different, that he had acted in self defence."
Mokadeh was shot in the leg around three weeks after Mohammed was stabbed.
He claims a friend told him Sami had ordered the shooting.
Mokadeh denies one count of murder.
The jury are expected to go out tomorrow to consider their verdict.
The trial continues.