Oscar Pistorius fired a gun in a crowded restaurant, and told a friend to take the blame because of the "media hype" surrounding him, a month before he shot his girlfriend, a court heard on Wednesday.

The testimony from a friend of the accused came as the prosecution in South Africa's high-profile murder trial opened a new line of attack, apparently seeking to portray Pistorius as irresponsible and trigger happy.

Kevin Lerena, a professional boxer who calls himself the KO Kid, said the incident happened at lunchtime on 11 January 2013 when he was with Pistorius and two friends, Darren Fresco and the British sprinter Martyn Rooney, at a restaurant in the upmarket Melrose Arch area of Johannesburg.

Fresco passed his gun to Pistorius under the table and told him there was a bullet in the chamber, Lerena said.

"A shot went off in the restaurant, then there was just complete silence," the 21-year-old continued. "Once the shot went off, I was shocked. I looked down, and just where my foot was stationary there was a hole in the floor. I had a little graze on my toe. I wasn't hurt or injured."

He added that there was blood and "there could have been a fatality", but he did not require medical attention.

Before the restaurant management approached the table, Lerena continued, Pistorius asked Fresco to say he was responsible for the shot. "Oscar said to Darren, 'just say it was you. I don't want any tension around me. Just say it was you. Please take the blame for me, there's too much media hype around me'. And Darren took the blame for him."

Lerena added: "When Mr Fresco spoke to the restaurant owners, he did say the gun was caught on my [Fresco's] pants, to take the rap for Oscar."

Lerena said they paid the bill and left the restaurant, and he never spoke about the incident. But, he said, two days after Pistorius shot his girlfriend, Reeva Steenkamp, he woke to find more than 100 missed calls on his phone as media from around the world tried to contact him to ask about the restaurant accident.

Jason Loupis, owner of the Tashas restaurant, also took the witness stand. He said the restaurant was packed with about 200 people that day. "I heard a loud bang. It sounded like a gun but I hoped not. I hoped it was a balloon."

He walked over to Pistorius' table and asked what had happened. "They all looked at me … Mr Fresco then said, 'sorry Jason, my gun fell out of my tracksuit pants'. I said, 'are you being serious? This is not a joke'," Loupis recalled.

Loupis's wife, Maria, said: "Darren spoke to me and told me the gun fell out of his pants, his tracksuit pants … I said to him 'what's the first rule of owning a gun? Safety first?' He said 'yes', and I hit him over the head."

Pistorius paid the bill and the group left, she added. She also agreed that the shot went off near to where a child was sitting, although the defence countered that a wall was between them.

The incident at Tashas is one of three additional charges Pistorius, 27, faces at the Pretoria trial. He is also charged with firing a gun through a moving car's sunroof, and with illegal possession of ammunition.

The state is expected to use these incidents to illustrate a pattern of reckless behaviour in their argument to prove the "blade runner" deliberately gunned down 29-year-old Steenkamp on Valentine's day last year. Pistorius denies the charges.

Earlier on Wednesday, the defence counsel, Barry Roux, sought to undermine the prosecution testimony of a couple who live near Pistorius's luxury home.

Charl Johnson, and his wife Michelle Burger, have testified to hearing a woman screaming, a man shouting for help and then gunshots.

During his cross-examination of Johnson, Roux said phone call records would show that Pistorius called an estate manager at about 3.19am, soon after he used a cricket bat to break down the door of the toilet where Steenkamp died.

Johnson and Burger's testimony says they heard what they called shots straight after making a call to security at 3.16am. The similar times show the sounds were that of the bat hitting the door, Roux argued.

"There is only one thing you could have heard, because it coincides precisely," Roux said to Johnson. "That was the time that he [Pistorius] broke down the door [with the bat]."

Johnson replied, addressing the judge: "My lady, I am convinced the sound I heard was gunshots."

Johnson also said that after Roux had revealed his mobile phone number in court on Tuesday he had received large numbers of calls and text messages, including a threat which said: "Why are you lying in court? You know Oscar didn't kill Reeva. It's not cool."

In court were members of the ANC women's league, and the Gauteng province premier, Nomvula Mokonyane. They said they wanted to highlight the issue of gender-based violence in South Africa. "Every child is my child and [Reeva] is my child. So we will be on the side of Reeva's mother," Mokonyane said.