Miami Heat center Hassan Whiteside had a brand-spanking-new $50,000 assault rifle stolen from his $400,000 Rolls Royce after he left the car unlocked in the parking lot of the gun store where he made the purchase.

The truly bizarre series of events happened on July 5, when Whiteside bought a Colt M16 — the same gun used by the US army — ammo, a rifle bag and a silencer from Johnson’s Firearms in Miami, according to Miami sports journalist Andy Slater.

The big man then drove off to get a workout in at the University of Miami.

According to Slater, Whiteside left his car unlocked as he practiced, and when he woke up the next day at his home, he realized his new gun and all his gear was gone.

Soon thereafter, Whiteside called police and relayed the same timeline to the cops — after purchasing the gun he only spent time at the gun store, on the University of Miami’s campus and at his home.

Surely, Whiteside believed, the gun was stolen when he was on campus.

Retracing the center’s day, cops checked security footage at The U and discovered that Whiteside was the only person who entered or exited his Rolls while he was on campus.

Two weeks after that, Whiteside and his lawyers called the police back. Apparently, Whiteside remembered that he had left the gun and all the accessories he purchased all alone in the unlocked Rolls right after he made the purchase.

With this new revelation in hand, police determined that the gun and gear were stolen from the gun-store parking lot literally minutes after Whiteside made his purchase.

Luckily for Whiteside, the gun and ammo were recovered in a stolen vehicle a few weeks later. The silencer also was eventually found.

Whiteside, who has spent his six-year NBA career with the Heat, is averaging almost 14 points, 15 rebounds and three blocks per game.

In October 2017, he posted a video on Instagram in which he is seen shooting an MK18 assault rifle that he said he owned.

The MK18 is a smaller version of the M16 that was stolen in July.