Rapper A$AP Rocky has pleaded not guilty to two charges of assault with a firearm in connection with a shooting in Hollywood last November.
The star, real name Rakim Mayers, is alleged to have pointed the gun at a former friend during an argument.
Prosecutors say he later fired the weapon twice in the direction of the victim, who sustained a minor injury.
The 33-year-old, who has had two US number one albums, could face up to nine years in prison if found guilty.
The rapper, who had a baby with singer Rihanna in May, appeared in court in Los Angeles on Wednesday.
The star was arrested at Los Angeles International Airport in April, as he returned from a holiday with Rihanna. He was released three hours later – after posting bail of $550,000 (£421,000).
Terell Ephron, who is part of the A$AP Mob hip-hop collective, identified himself as the victim and took legal action against his former friend last week – alleging assault and battery, negligence and emotional distress.
Mr Ephron, known as A$AP Relli, alleged that Mr Mayers had “lured” him to an obscure location in Hollywood to discuss a disagreement.
The lawsuit claims that, after a verbal altercation, Mr Mayers “pulled out a handgun and purposefully pointed it in the direction of [Mr Ephron] and fired multiple shots”.
Mr Ephron was “struck by bullet projectile/fragments” in his left hand and required medical attention, according to the court papers. He is seeking at least $25,000 (£20,750) in damages.
At Wednesday’s hearing, judge Victoria B Wilson put a restraining order in place, ordering Mr Mayers to stay 100 yards (91m) away from Mr Ephron at all times, and set a preliminary trial date of 2 November.
Mr Mayers was previously given a two-year suspended sentence for his role in a brawl in Stockholm in August 2019.
As A$AP Rocky, he was one of the biggest breakout stars of the 2010s, earning eight platinum singles in the US, including Wild For The Night, Everyday, LSD and A$AP Forever.
He rose to fame after being championed by Drake, and has worked with artists including Alicia Keys, Lana Del Rey, Skepta, Selena Gomez and Kendrick Lamar.
Last year, he confirmed he was in a relationship with Rihanna, calling her the “love of my life” and “the one”.