The wife of the alleged ISIS gunman suspected of wiping out 39 people in an Istanbul nightclub on New Year’s Eve insists she had no idea her husband was a terrorist.

“I learned about the attack from the TV. I didn’t know that my husband was an ISIS militant, let alone a sympathizer,” the woman told police, the Hurriyet Daily News in Turkey reported on Tuesday.

The killer’s name has not been released, but Turkish media, citing police sources, said he was from the Central Asian country of Kyrgyzstan.

The gunman used his cellphone to record himself walking in Taksim Square, a popular Istanbul tourist site, just days before the massacre, according to the selfie footage, which was released Tuesday.

Investigators were examining the video to determine whether he was scoping out potential targets or sending ISIS leaders a cryptic message.

The killer had been with his wife and two children in Kyrgyzstan until Nov. 22, when he hopped a plane to Istanbul, the Turkish news agency said.

Other newly released surveillance footage showed him on the night of the slaughter, holding a backpack and smoking a cigarette while climbing into a cab in the Zeytinburnu district of Istanbul. This was just about an hour before the attack.

After being driven to the club Reina overlooking the Bosporus, the suspect sprayed security guards manning its entrance with a barrage of bullets from a Kalashnikov rifle.

He then barged inside and detonated a stun grenade before indiscriminately shooting dozens of New Year’s revelers, killing the 39 and wounding scores more.

After the massacre, the killer jumped into a cab to flee the scene and asked to use the driver’s cellphone, Hurriyet said.

The driver let him use the phone, leading some investigators to believe that the killer was calling an accomplice.

Police have questioned the cabdriver, who said the killer spoke Turkish.

ISIS has claimed responsibility for the massacre, calling the gunman “a soldier of the brave caliphate.”

Investigators Tuesday detained two foreign nationals at Istanbul’s Ataturk International Airport in connection with the attack.

A total of 16 people have been arrested for their suspected roles in the massacre.