Turkey has identified the gunman in the Istanbul nightclub massacre, the foreign minister said Wednesday as the president vowed that the country won't surrender to terrorists or become divided.

The gunman, who killed 39 people during New Year's celebrations at the Reina club, is still at large. But Foreign Minister Mevlut Cavusoglu said authorities had identified the man, without providing details.

"The identity of the person who carried out the attack on the Reina nightclub has been established," Cavusoglu told Anadolu in a live televised interview.

Turkish police, meanwhile, detained at least five suspected Islamic State militants believed to be linked to the attack, the state-run news agency reported. The operation was launched in the Aegean port city of Izmir and was ongoing, Anadolu Agency said.

ISIS has claimed responsibility for the attack, which also wounded nearly 70 people. Of those killed 27 were foreigners, many from the Middle East. Islamic State said a "soldier of the caliphate" had carried out the mass shooting to avenge Turkish military operations against ISIS in northern Syria.

President Recep Tayyip Erdogan said that the attack aims to set Turks against each other and deepen fault lines, but the country won't fall for this game.

Erdogan made the comments in a live speech from Ankara, the first time he has publicly addressed the nation since the attack.

Keep updated: Sign up to our newsletter

Email*

Please enter a valid email address

Please wait…

Thank you for signing up.

Oops. Something went wrong.

Thank you,

Responding to accusations in the past that Turkey had given support to the Islamic State, Erdogan said that "to present the country which is leading the greatest struggle against Daesh as one supporting terrorism is what the terror organization wants."

Erdogan said that "in Turkey, 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."

He also said that "to say Turkey has surrendered to terrorism is to take sides with the terrorists and terror organizations."

Police in Istanbul have set up checkpoints and are checking vehicles across the city as security levels remained high. Police were stopping cars and Istanbul's ubiquitous yellow taxis, with passengers and drivers holding up their identifications while officers inspected inside the vehicles. Istanbul has been on high alert since the attack, with the gunman still at large.

The private Dogan news agency said that Wednesday's police operation targeted three families who had arrived in Izmir about 20 days ago from Konya — a city in central Turkey where the gunman is thought to have been based before carrying out the nightclub attack. It said 27 people, including women and children, were taken into custody.

At least 14 people were previously detained in connection with the attack, including two foreigners stopped Tuesday at the international terminal of Istanbul's Ataturk Airport after police checked their cellphones and luggage, according to Anadolu.

Turkish media reports claimed Tuesday that the gunman's wife was in custody and had told police she didn't know her husband was linked to ISIS. An eerie selfie video emerged of the alleged gunman on Tuesday, showing him silently touring Istanbul's most famous square. The camera never leaves the man's unsmiling face as he walked through Taksim Square during the 44-second clip that was broadcast on state-run Anadolu television and other Turkish media.

Funerals were held in Jordan, Lebanon, Israel and Turkey for the dead and on Wednesday, a Turkish Airlines jet carrying the bodies of two Indian citizens killed in the shooting landed in Mumbai. The bodies were received by a governing party lawmaker, and the victims' relatives and friends.

Bollywood film producer-realtor Abis Rizvi's body was taken to his home in suburban Bandra for burial later Wednesday. The 49-year-old Rizvi wrote, produced and directed a Bollywood movie "Roar: The Tigers of Sunderbans," in 2014 aimed at spreading awareness about tigers.

The other Indian victim of the Istanbul attack was Khushi Shah, a 39-year-old fashion designer from Vadodara, a city in the western Indian state of Gujarat. Shah's body was flown to her hometown for cremation later Wednesday, the Press Trust of India news agency reported.

Late on Tuesday, Turkey's parliament voted to extend by a further three months a state of emergency that was declared in the aftermath of the failed July 15 coup. Turkey imposed the state of emergency to crack down on a network linked to U.S.-based Muslim cleric Fethullah Gulen, accused of orchestrating the coup attempt. Gulen denies any involvement.

Haaretz.com, the online edition of Haaretz Newspaper in Israel, and analysis from Israel and the Middle East. Haaretz.com provides extensive and in-depth coverage of Israel, the Jewish World and the Middle East, including defense, diplomacy, the Arab-Israeli conflict, the peace process, Israeli politics, Jerusalem affairs, international relations, Iran, Iraq, Syria, Lebanon, the Palestinian Authority, the West Bank and the Gaza Strip, the Israeli business world and Jewish life in Israel and the Diaspora.