According to TMZ the platinum rapper  allegedly tried to smuggle a gun into an airport on 9/11 —  he claims there’s actually a heroic reason why the pistol turned up in his luggage.

Pablo — real name Moses Barrett III — was arrested on Saturday at RDU Airport in North Carolina after a TSA officer found a Smith & Wesson pistol in his carry-on.

According to cops, Pablo was busted at Raleigh-Durham International Airport — he was allegedly on his way to Los Angeles and the MTV Video Music Awards. We’re told the rapper was going through security and the gun was spotted in his carry-on bag — security then called airport police.

Pablo, real name Moses Barrett III, was charged with carrying a concealed weapon, possession of a firearm by a felon and possession of a stolen firearm. He posted $50,000 and was released.

But Petey’s says the rapper can explain — claiming the gun actually belongs to one of his friends. And last month, Petey learned that said friend planned to use the pistol to “do something crazy” … so Petey stepped in and literally took the weapon away.

The rep tells us Petey stashed the gun in a luggage bag so his friend wouldn’t find it — and when he was asked to hop on a last-minute flight to L.A., he grabbed the loaded bag without thinking.

Petey was arrested on suspicion of carrying a concealed weapon, possession of a firearm by a felon and possession of a stolen firearm.  He’s due back in Wake County Court October 4.