The firearm that has Lil Xan under investigation currently by the LAPD ... looks very similar to a handgun he whipped out -- suddenly and unexpectedly -- during a photo shoot.
We've obtained behind the scenes images from the shoot Xan did back in January ... where he clearly brandishes the piece and showed it off to people on set.
Sources who were there tell TMZ ... the gun was NOT supposed to be part of the shoot, and Lil Xan just brought it with him and surprised everyone when he pulled it out. We're told everyone felt it was a real gun ... although he never said for sure.
We broke the story ... Lil Xan pulled a gun on a man at a gas station last week, and it looks almost identical to the one in the photos. The rapper's affinity for guns could get him in big trouble.
Cops are looking into the gas station incident as a possible case of assault with a deadly weapon -- a felony that could land him in prison if convicted ... however, Xan has not been arrested or booked for any crime. Yet.