A$AP Rocky has been charged with two counts of assault with a firearm in Los Angeles, the authorities have said.
Discharging a gun in a public place is a "serious offence that could have ended with tragic consequences", a local official said.
The US rapper, whose real name is Rakim Mayers, allegedly pointed a handgun at a victim in November last year.
On Monday, the Los Angeles County District Attorney's office charged the New Yorker with two counts of assault with a semi-automatic firearm with allegations of personally using a firearm.
He also allegedly fired the weapon in the direction of the victim in a subsequent confrontation, the district attorney's office said.
Mayers, 33, welcomed his first child with Rihanna, 34, one of the biggest-selling music artists of all time, in May.
"Discharging a gun in a public place is a serious offence that could have ended with tragic consequences not only for the person targeted but also for innocent bystanders visiting Hollywood," district attorney George Gascon said.
"My office conducted a thorough review of the evidence in this case and determined that the addition of a special firearm allegation was warranted."
Mayers is scheduled to enter a plea to the charge on Wednesday in Los Angeles.
The case remains under investigation by the robbery and homicide division of the Los Angeles Police Department.
A$AP Rocky is known for songs including F***** Problems, Praise The Lord and Everyday.