ISTANBUL — Turkish authorities have identified the gunman who shot dead dozens of revelers at a nightclub in Istanbul on New Year’s Eve, Turkey’s top diplomat said on Wednesday, as police stepped up raids against suspected militant hideouts as part of the hunt for the attacker who is still at large.

Despite the apparent breakthrough in the investigation, the government did not immediately name the gunman or disseminate his photograph, although he remains at large. The dearth of information deepened a sense of public unease and confusion over the attack, which occurred even though Turkish authorities have blanketed the country with security in recent months.

The rampage on Sunday, which killed 39 people from more than a dozen countries, was claimed by the Islamic State and marked one of the worst mass killings in Turkey in recent memory.The country has been reeling from a steady stream of violence, including the assassination of the Russian ambassador last month and earlier bombings targeting police and tourist sites.

Speaking to the state-run Anadolu news agency, Foreign Minister Mevlut Cavusoglu gave no further details on the suspect’s identity, but said the investigation is ongoing.

At least 20 people were arrested in the western city of Izmir on the Aegean coast, Anadolu reported Wednesday, quoting a police official. Many of those detained reportedly lived with the attacker. Police also seized night-vision equipment, a sniper scope and “other military equipment,” the agency said.

“The home he stayed in has been found and investigated – also, his connections and who has helped him,” he said, adding that the Interior Ministry is working diligently to find the attacker.

He also said the attack appeared to have been “prepared professionally.”

In a nationwide address, Turkish President Reçep Tayyip Erdogan said the carnage sought to divide Turkey, but the nation will not fall “for this game.”

Erdogan sought to reassure Western-oriented Turks who are increasingly alarmed about Islamist forces in their country, which has strong secular traditions going back nearly a century. “In Turkey,” Erdogan said, “no one’s way of life is under any threat. Those who claim this have to prove it. It is my duty to protect everyone’s rights.”

Turkish officials imposed an immediate blackout on news coverage of the nightclub attack, citing national security concerns. Since then, official information about the attacker and his potential links to the Islamic State has been scarce. Filling the void have been conflicting accounts in the Turkish press about the man’s identity and the path he followed to the club, where hundreds of people were celebrating the new year.

In recent days, police have released a blurry photograph of the alleged attacker that appears to have been taken from surveillance camera footage. News media have also disseminated a selfie video purported to be of the suspect, but with no information about his identity. It was unclear how the cellphone video was obtained.

The passport of a 28-year-old Kyrgyz man was published Tuesday by the Turkish state broadcaster’s English-language channel, TRT World, and subsequently circulated on social media. But the man was later found in Kyrgyzstan and cleared of involvement in the attack, according to reports in the Kyrgyz press.

Then, on Wednesday, residents of the Istanbul neighborhood of Pendik were shown beating a man they believed to be the attacker, Turkish media reported. A video surfaced of men slapping the man and pinning him down on the street before plainclothes police arrived.

Turkey, a NATO member and close ally of the United States, has experienced a rash of attacks by various actors in recent months, including bombings widely believed to be carried out by the Islamic State.

The Islamist militant group claimed that the attack was carried out by one of its “soldiers,” asserting responsibility for an attack the group said was in response to Turkish military actions.

Turkey’s military has backed an offensive by Syrian rebels to oust the Islamic State from areas near its border, and Turkish warplanes and artillery have pounded the militants’ positions inside Syria for months.

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.