ISTANBUL — The Islamic State on Monday issued a rare claim of responsibility for an attack in Turkey after a New Year’s Day shooting at an Istanbul nightclub that killed at least 39 people, describing the gunman who carried out the assault — and who has not been identified or captured — as “a hero soldier of the caliphate.”

The Turkish authorities are still searching for the gunman, who killed a police officer guarding the Reina nightclub before going on a shooting rampage with a rapid-fire rifle, but the state news media reported that eight suspects had been detained in connection with the attack.

The authorities on Monday released two photographs of the person suspected of being the gunman, captured by security cameras, that showed a dark-haired, cleanshaven man in a dark winter coat. The government’s spokesman, Numan Kurtulmus, said at a news conference that investigators believed they found the assailant’s fingerprints and that they were close to identifying him.

Mr. Kurtulmus did not mention the Islamic State specifically, but he said Turkey would press the fight against terrorism.