An Italian tourist was stunned when the FBI showed up at his home in Sardinia to ask about one of his New York vacation photos — because ISIS had Photoshopped the snap to make him look like a jihadi.

The agency’s New York chief of counter-terrorism on Thursday told the incredible tale of how agents tracked down the true subject of the selfie, which appeared to show an ISIS adherent outside the Met and made headlines in the wake of the Port Authority bombing.

“He [said he] enjoyed his time in New York City. He had a fabulous time. He was shocked and surprised and, as a matter of fact, had no affiliation with ISIS and was a little surprised that his photo had been taken,” Joint Terrorism Task Force head C. Bryan Paarmann told reporters of the tourist’s reaction when agents knocked on his door.

After ISIS released the image — depicting a man wearing an ISIS-branded scarf over his face outside the Metropolitan Museum of Art — investigators determined there was an 80 percent chance it was doctored, he said.

But with 20 percent still a nagging possibility, a squad was sent to the museum, where it worked out exactly where the selfie was taken and pulled surveillance footage to scour for the man in the scarf, Paarmann said.

Once they found the guy on video — he’d visited a few days before Christmas — they traced the credit card he used to pay for entry, and then found his social media accounts.

“We tracked him halfway around the world, back to his home country, and in conjunction with his nation, went and looked him in the eye and said, ‘Hey.’

“What it turns out, this guy’s a tourist. He just came to New York City during the holiday season. Did he have a black scarf on? Absolutely. Did he have an ISIS logo on? No.”

The terrorist organization pretty regularly doctors generic photos of the Big Apple to make them seem threatening, Paarmann said — and the fact that it’s resorting to swiping other people’s vacation shots shows that it is getting “desperate,” Paarmann said.

“To me it’s concerning. But to me, I think it’s also indicative of the level of desperation that ISIS is utilizing innocent people’s photographs and hijacking them for their own propaganda purposes,” he said.