Former N-Dubz singer Dappy told a court he was "scared" when he allegedly slapped a man at nightclub as he feared he might be stabbed.
The 27-year-old, whose real name is Dino Costas Contostavlos, is accused of attacking George Chittock in the early hours of February 27.
He denies assault by beating and is standing trial at Chelmsford Magistrates' Court.
Prosecutor Jacqueline Carey told the court the incident happened after Dappy performed at Chicago's in Chelmsford, Essex, and carried out a "meet and greet" with fans.
CCTV footage showed Dappy "surrounded by security" when he turned and "slapped" Mr Chittock near the club's smoking area at about 2am, Ms Carey said.
"When the defendant lashed out, he was not under any threat or any perceived threat of violence," the prosecutor said.
Contostavlos claimed he was acting in "self defence" after Mr Chittock had abused him three times over the course of the night, including insulting his dead father.
Giving evidence, the performer said he heard someone say "Oi" or "What" as he left the smoking area and turned around to see Mr Chittock, who stamped his foot on the ground.
"He was being threatening towards me," he said. "I thought he was going to hit me. He's right next to me. How can he get this close to me again?
"I lifted up my hand and tried to move him away from me. If it was an attack it would have been repeatedly with closed fists."
Dappy said he had a scar on his hand after grabbing a blade when someone tried to stab him in Nottingham four or five years ago.
"I've been knocked out before, cold, on the back of my face, frothing," he said.
"It takes one second for someone to put something in my ribcage.
"I was scared."
In a police statement read to the court earlier, Dappy said he feared "someone was going to put a hole" in him during the Chicago's incident and he had been attacked on three occasions over the previous 12 months.
"I have had to deal all my life with people trying to cut me and taking cheap shots," he told police. "He looked like he was going to do something. It was self-defence, I did not want to get hit."
During cross-examination, Dappy told the court he was "a million per cent" sure that Mr Chittock had called him a "mug" as he arrived at the event.
"It was a violation," he said. "Tesco, Asda, everywhere I go there's always one person to make a rude remark.
"I've got two kids. I don't want my two kids knowing their father gets called a mug.
"This is a stitch up. This is what's happening in this case."
Dappy said Mr Chittock had been "intimidating" and "violating" him throughout the night.
"He could have stabbed me," he said. "I've been through it. I've been scrutinised. I've been signed since 17 years of age. This happens all the time. I thought he was going to lash out at me. I don't want to get stabbed. I don't want to get hurt again."
Ms Carey suggested that Dappy slapped the alleged victim because he was annoyed to see him still in the club after being called a "mug".
He replied: "You obviously don't like me as a person. I didn't slap him. I moved him away."
Dappy said the event at Chicago's was the first time he had worked with his personal security guard on duty and he had not worked with him since.
"He wasn't used to that level of fame," he said.
Giving evidence, Mr Chittock denied that earlier in the evening he told Contostavlos: "Dappy, you're a mug, I'm going to knock you out."
Jon Harrison, defending Dappy, suggested that on a second occasion, Mr Chittock was ejected from a VIP area after saying to the performer: "Do you remember me, you pussy?"
The alleged victim agreed he had been ejected from the area as the star had his photo taken with fans but said it was the result of a misunderstanding and he did not say anything abusive.
Asked whether he had said to Dappy "go suck your dead dad" seconds before he was slapped, Mr Chittock said: "I would not say that, I have close family members who have died and that is not right."
Mr Harrison asked whether he knew that Dappy's father was dead. Mr Chittock said: "I don't know anything about his family.
"I'm not a fan of him, I don't care what goes on in his life. His life and my life are separate."
In response to suggestions that he had deliberately intimidated Dappy, Mr Chittock added: "I was not in his face. I was not in his personal area. He turned around to strike me."
The court heard that a friend of Mr Chittock tweeted shortly after the incident: "George started on Dappy."
James Armstrong, a security worker at Chicago's, told the court Dappy drank half a bottle of Grey Goose vodka and some Jack Daniels while at the club.
"I could tell later in the night he was very intoxicated," he said. "I thought it was a bit peculiar someone of his stature was drinking from the bottle.
"That bottle remained with him most of the night."
During his evidence Dappy insisted he did not have a "drinking habit", adding: "I was functional enough to go and do an amazing show so I certainly wasn't drunk."
Telling the court he was about 5ft 4ins and weighed eight stone, he said: "Look at me I couldn't down half a bottle of vodka in the space of 20 minutes of me going on stage."
Dappy, wearing a black jacket, white shirt and black tie, arrived at court in a black Audi with blacked-out windows. His friend, comedian Jim Davidson, also attended in a show of moral support.
The former N-Dubz star finished in second place to Davidson on reality show Celebrity Big Brother a month before the alleged incident.
Dappy, of St Albans, Hertfordshire, is on unconditional bail.