A man was shot during row over a faulty speaker at a drinking venue in Leeds, a jury was told.
Lloyd Aikens survived the shooting despite a bullet travelling through his shoulder and neck and coming to rest near his spine.
Leeds Crown Court heard Jeremy Rawlins fired a revolver at Mr Aikens as the two men fought during the disturbance at a club in Chapeltown known as The Hole.
Rawlins, known to his friends as Tupac, is on trial accused of attempted murder, causing grievous bodily harm with intent and possession of a prohibited firearm.
Rupert Doswell, prosecuting, told the court how the shooting took place as other members of the public were in the venue on Back Newton Grove on April 28 this year.
The court heard the incident happened when Mr Aikens was asked to fix a speaker.
Mr Aikens, whose nickname is Crazy, became upset when he felt someone tapping the side of his head as he bent down to tune the speaker in the DJ booth.
He accused Rawlins of "secretly abusing" him but Rawlins claimed he was just shining the light from his mobile phone so Mr Aikens could see better.
The prosecutor said Mr Aikens refused to continue fixing the speaker when Rawlins called him an "idiot".
Mr Aikens went outside but returned to work on the speaker when people became upset that there was no music.
The alleged attack then took place inside the venue.
The prosecutor said Rawlins struck Mr Aikens in the face with an object wrapped in cloth.
He said: "The prosecution say that item was the revolver that the defendant brought to the club."
The jury heard Mr Aikens' glasses were knocked off and his face started to bleed as he was pushed to the ground by Rawlins.
Mr Doswell said: "Mr Aikens will tell you that he was then shot."
The court heard Mr Aikens managed to fight back and grab the barrel of the gun.
The two men fought, falling down a flight of stairs as they struggled.
Rawlins suffered injuries to his face during the struggle.
Mr Aikens managed to grab hold of the weapon and run out of the club despite being badly injured.
Mr Doswell said he realised he needed medical help but was concerned about turning up at a hospital with a gun.
The court heard Mr Aikens buried the weapon on scrub land on Leopold Street before contacting a friend to take him to hospital.
Mr Aikens was too afraid to go to St James' Hospital in Leeds in case he came into contact with Rawlins.
He went to hospital in Blackburn where a scan showed he had been shot.
Mr Doswell said: "He was very fortunate that it did not penetrate his spinal cord."
Rawlins went to St James' Hospital where he told staff he had been shot.
He had a serious wound to his face but medics said the injury was not consistent with a gunshot wound.
Mr Doswell said: "It was a laceration caused by a knife and not a gunshot."
Police recovered the revolver and it was found to contain three live rounds and two spent rounds.
Rawlins was arrested and gave an account to police that Mr Aikens had come at him with a weapon when he was at the top of the stairs at The Hole.
He said the gun was discharged during the struggle and that Mr Aikens reached for a knife and slashed him across the face.
Mr Aikens described the incident when he gave evidence before the jury.
He said: "I can feel my heart pumping through my chest. I can smell fire. My ears were ringing."
"I ran for my life from that building."
Rawlins, of Mexborough Grove, Chapeltown, pleads not guilty to all charges.
The trial continues