A heroic motorcyclist tried to hijack the truck used by the Bastille Day attacker — racing alongside the driver’s door and even attempting to open it — before crashing and going under the wheels.

Shocking cellphone video shot by German journalist Richard Gutjahr shows the terrifying encounter in the French resort of Nice on Thursday.

In the footage, the man on the motorcycle can be seen speeding up to the driver’s side of the truck as police officers chase the vehicle on foot.

“It was like a [scene from] a movie,” Gutjahr recalled to the Meduza news website on Friday.

Despite being unarmed, the motorcyclist didn’t hesitate as he tried to hijack the truck — which was driven by man identified as Mohamed Lahouaiej Bouhlel, a 31-year-old French-Tunisian, according to law enforcement sources.

“Surprisingly, [Bouhlel] drove very slowly, not fast. He drove slowly and he was chased by [the] motorcyclist,” Gutjahr told Agence France-Press. “The motorcyclist attempted to overtake the truck and even tried to open the driver’s door, but he fell and ended up under the wheels of the truck.”

Gutjahr said it was unclear whether the man had survived.

Bouhlel, a petty criminal and married delivery driver, took the lives of 84 people and left more than 200 injured on Thursday when he crashed his rented refrigerator truck into scores of Bastille Day revelers.

On Friday, Gutjahr recalled how the madman was driving aimlessly through the crowd.

“[Bouhlel] stepped on the accelerator and the truck sped up, accelerated and drove in a zigzag course into the crowd,” he told AFP. “The panicked crowd ran in all directions. Those who could save themselves ran into the hotels, or sought security in the hotel entrances … Right afterwards I personally saw 12 dead bodies, and it was already clear there would be more.”

Gutjahr said he saw at least three members of France’s national police chasing the truck on foot and exchanging fire with Bouhlel.

“In the next 15 to 20 seconds, there were shots from several guns,” Gutjahr said. “I don’t know who shot at whom.”

Bouhlel — who yelled “Allahu Akbar!” during his rampage — managed to continue driving for another 1,000 feet before being surrounded by officers and shot dead in a hail of bullets.