
ISTANBUL — An eerie video emerged Tuesday of a man believed to be the attacker who killed 39 people in a mass shooting at a nightclub, showing him taking a selfie as he silently toured Istanbul’s most famous square.
The camera never leaves the man’s unsmiling face as he walks through Taksim Square during the 44-second clip that was broadcast on state-run Anadolu television and other Turkish media.
It wasn’t immediately clear if the video was made before or after the New Year’s massacre at the Reina nightclub, or how it was obtained. The gunman, who hasn’t been publicly identified, is still at large.
At least 14 people have been 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.
On Monday, the Islamic State group claimed responsibility for the attack, which also wounded nearly 70 people. The extremists said a ‘‘soldier of the caliphate’’ had carried out the shootings to avenge Turkish military operations against ISIS in northern Syria.
Funerals began Tuesday in Jordan, Lebanon, Israel, and Turkey for the dead, most of them tourists. Mourners wept for the lives that were cut short in the early hours of 2017 at the popular and glamorous club.
Thousands attended the funeral of Layan Nasser, an 18-year-old Arab Israeli dental assistant who was buried in the Israeli city of Tira.
‘‘She had dreams to work, to progress, to study, to raise a family, but unfortunately the terror put an end to her dreams,’’ said Tira Mayor Mamoun Abd El Hai.
Hundreds of people attended funerals for two of three Lebanese victims. One of them, 26-year-old fitness instructor Elias Wardini, was recently engaged to be married. His family and friends set off fireworks as his white coffin arrived at a church in Beirut.
The Hurriyet newspaper said a woman identified by Turkish media as the wife of the suspect has told police she didn’t know her husband was a member of the Islamic State.
The woman was detained in the central town of Konya as part of the investigation. Neither she nor her husband has been identified. Hurriyet reported in its online edition that the woman said she learned about the attack on TV and told police she didn’t know her husband harbored ‘‘sympathies’’ for ISIS.
Media reports said the gunman flew to Istanbul from Kyrgyzstan with his wife and children on Nov. 20. From there, they drove to the Turkish capital, Ankara, before arriving two days later in Konya.
The family rented a studio there, paying three months of rent in advance. The gunman told the real estate agent he was looking for work, according to the report.
Hurriyet said the gunman returned to Istanbul Dec. 29.
Several media outlets, citing unidentified security sources, reported Monday that the man was believed to be from Central Asia and may have been part of the cell that attacked Ataturk Airport in June, killing 45 people.
On Tuesday, the Haber Turk newspaper said the man is thought to be a member of China’s Muslim Uighur minority. Turkish media showed photos of a Kyrgyz passport, but police said it did not belong to the gunman.
The assailant, armed with a long-barreled weapon, killed a policeman and a civilian early Sunday outside the Reina nightclub before opening fire on the estimated 600 revelers inside. The club is frequented by local celebrities, including singers, actors, and athletes.
Turkey has been rocked by violence in the past year, carried out by ISIS as well as by Kurdish militants. The government survived a failed coup in the summer and is fighting Kurdish insurgents.
Interior Minister Suleyman Soylu told Parliament that authorities thwarted 339 possible attacks in 2016, including 313 by the outlawed Kurdistan Workers’ Party, or PKK, and 22 by the Islamic State group.
Lawmakers are to decide later whether to extend the state of emergency that was declared after the coup attempt.
Soylu said authorities seized 247 explosive devices and 23 car bombs and detained 23 would-be suicide bombers last year.
He said about 80 of last year’s attacks were thwarted in the past three months. More than 3,506 ISIS suspects were detained in 2016, including 1,531 foreign nationals,.
Soylu said the authorities had stepped up security on public transportation as well as at airports and train and bus terminals.
Turkey, a NATO member, launched an offensive in northern Syria in August in hopes of clearing a strategic border area of ISIS militants and stemming the gains of Kurdish fighters. Turkish jets regularly bomb ISIS targets in the Syrian town of al-Bab in support of Syrian opposition forces trying to recapture it from the extremists.
President Obama on Tuesday offered his condolences to Turkey’s leader over the nightclub massacre and a deadly attack on soldiers last month.
Obama and Turkish President Recep Tayyip Erdogan also agreed during their telephone conversation that their countries must ‘‘stand united’’ to defeat terrorism, the White House said.
Obama expressed sorrow over a Dec. 17 attack on off-duty Turkish soldiers in the central province of Kayseri that killed 13 troops. A wing of the outlawed Kurdistan Workers’ Party has said it was responsible.
The White House said Obama also welcomed Turkey’s efforts to help implement a nationwide cease-fire in Syria as well as the resumption of political talks between the Syrian government and the opposition.