The star was taken into custody at Los Angeles International Airport on Wednesday as he returned from a holiday with his girlfriend, Rihanna.
Police had been investigating the star, whose real name is Rakim Mayers, for his potential involvement in a non-fatal shooting in Hollywood last year.
He was released on bail of $550,000 (£421,000) shortly after his arrest.
The Los Angeles Police Department said the arrest was made in connection with an “argument between two acquaintances” which resulted in shots being fired.
The victim later told police that Mayers, who was walking with two others, approached him with a handgun on the street. They claimed Mayers shot at him three to four times and that he believed one of the bullets grazed his left hand, according to police reports obtained by NBC News.
In a statement on Twitter, LAPD said the victim had sustained a “minor injury” after which his assailants “fled on foot”.
Mayers’ lawyer, Alan Jackson, confirmed that his client had been arrested but declined to make any further comments.
The rapper will make his first appearance in court on 17 August.
The star was previously given a two-year suspended sentence for his role in a brawl in Stockholm in August 2019.
The rapper and two members of his entourage were convicted of kicking and beating a 19-year-old man after an argument. They said they acted in self-defence, but the court rejected their argument.
The case drew worldwide media attention after then-US president Donald Trump unsuccessfully tried to secure Mayer’s release from prison as he awaited trial.
Born in New York, Mayers was one of the biggest break-out 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.
His relationship with the billionaire musician and fashion mogul Rihanna was confirmed last year.
In an interview with GQ magazine last May, Mayers called Rihanna the “love of my life” and “the One”. The couple announced they were having a baby in January. In March, Rihanna told Elle magazine she was in her third trimester.