Play video content EXCLUSIVE TMZ.com

Lil Xan whipped out a handgun and pointed it at a man who demanded to know why the rapper once called Tupac "boring" ... and now LAPD is investigating.

TMZ obtained this video of the altercation which went down shortly before 10 PM Friday in a 7/11 parking lot near downtown L.A. The person shooting the video says he asked Xan why he "talked s**t" about Tupac last year in an interview. Ya might remember, Xan caught a ton of flak for calling Pac's music "boring."

Things amped way up when the guy called Xan a bitch. Xan flew off the handle and started shouting back at the guy, and dropped the n-word -- "What the f**k you want, bruh?? Get the f**k out, n***a!!!"

That's when Xan started flashing what looks like a semi-automatic handgun ... as he walked to his Mercedes-Benz SUV with his GF, Annie Smith. Annie yelled back at the man, "You started it, you dumb f**k."

As Xan got into the ride, he brandished the weapon one more time.

Xan and Annie drove off without any further incident, but the guy filed a report with LAPD. We're told detectives are now investigating, and they have seen this video.

For his part, Lil Xan says he only pulled out the gun to protect himself from an attack.

It's clear Xan feels the guy was antagonizing him over what now seems like ancient history -- his March 2018 comment about Tupac.

Or as Xan put it, "F**k all you old head ass bitches still talking bout that 2pac shit."

Interestingly, the 22-year-old rapper still refers to himself as a kid.