Here’s A$AP Rocky leaving LAPD headquarters – surrounded by several officers – after his arrest for a 2021 shooting.

The rapper posted $550k bail before he was able to walk out of police HQ Wednesday afternoon in DTLA, and directly into a waiting SUV in the rear parking lot.

This was several hours after he was busted at LAX.

As we reported, Rocky was arrested after flying back from Barbados with Rihanna on a private jet, with cops meeting him at the terminal and taking him away in handcuffs.

We’re told A$AP was arrested for assault with a deadly weapon with a gun … and our law enforcement sources say the arrest is for a November 6 incident where an alleged victim claims Rocky shot at him multiple times, and at least one bullet grazed his left hand.

Police also served a search warrant at A$AP’s home Wednesday in L.A., busting out a battering ram to get through his front gate.

ASAP Rocky surrounded by cops while exiting jail after LAX arrest

When cops wrapped up their search, they left Rocky’s house with a box of potential evidence.

Remember, Rocky had been in Barbados living it up with his pregnant gf RiRi … jet skiing and hanging with her family and friends.

ASAP Rocky surrounded by cops while exiting jail after LAX arrest

Major reversal of fortune, though, the second he got back stateside.