The driver who plowed into a group of people on Tuesday, killing eight, left behind handwritten notes pledging loyalty to ISIS along with an image of an ISIS flag inside his vehicle.

Sayfullo Saipov, 29, had the notes written in Arabic inside his Home Depot rental truck along with a picture of the ISIS flag, according to law enforcement sources.

The handwritten notes indicated that he had pledged allegiance to the terror group, the sources said.

Investigators discovered the materials inside his truck after the rampage in lower Manhattan.

The New York Times reported Tuesday night that Saipov had previously been on the radar of law enforcement as a result of an unrelated investigation.

It wasn’t clear if Saipov was the main target of that probe or just an associate of another figure being investigated, according to the report, which cited unnamed sources.

Additional reporting by Shawn Cohen