Play video content WPLG

XXXTentacion's murder happened in plain view of surveillance cameras, and the haunting video was played in public for the first time Thursday during a Broward County court hearing.

The video shows X walking into the motorcycle dealership in Pompano Beach, FL ... and you see two of the suspects follow him into the building. Later, his BMW is stopped on the street by the gun-wielding suspects.

Surveillance cameras recorded what we'd already known -- that X struggled with his assailants before they opened fire at point-blank range. One of them actually walked around to the passenger side and got into X's car before fleeing the scene.

Play video content TMZ.com

As we reported, the suspects made off with a Louis Vuitton bag and $50k in cash.