The Islamic State said in a statement on Monday that it was responsible for a New Year’s shooting spree at an Istanbul nightclub that left 39 people dead and nearly 70 wounded, while authorities were still searching for the gunman.

The terror group said through its Aamaq News Agency that the attack was carried out by a “heroic soldier of the caliphate who attacked the most famous nightclub where Christians were celebrating their pagan feast.”

Turkish authorities believe that the gunman came from a Central Asian nation and is likely to either be from Uzbekistan or Kyrgyzstan, Turkish media reported citing unnamed sources.

Police had also established similarities with the high-casualty suicide bomb and gun attack at Istanbul's Ataturk Airport in June and was investigating whether the same ISIS cell could have carried out both attacks, the papers reported.

The unidentified gunman, who is still at large, killed a policeman and another man outside the Reina club in the early hours of 2017 before entering and firing at about 600 revelers partying inside with an automatic rifle.

"Unfortunately, (he) rained bullets in a very cruel and merciless way on innocent people who were there to celebrate New Year's and have fun," Istanbul Gov. Vasip Sahin told reporters.

Nearly two-thirds of the victims were foreigners, many from the Middle East, according to Turkey’s state-run Anadolu Agency. The report said the bodies of 25 foreign nationals killed in the attack would be delivered to their families later Monday.

The mass shooting followed more than 30 violent acts over the past year in Turkey, which is a member of the NATO alliance and a partner in the U.S.-led coalition fighting against the Islamic State group in Syria and Iraq. The country endured multiple bombings in 2016, including three in Istanbul alone that authorities blamed on IS, a failed coup attempt in July and renewed conflict with Kurdish rebels in the southeast.

President Recep Tayyip Erdogan vehemently condemned "the terror attack in Istanbul's Ortakoy neighborhood in the first hours of 2017" and offered condolences for those who lost their lives, including the "foreign guests."

Among the dead were an 18-year-old Israeli woman, three Indians, three Lebanese, a woman with dual French-Tunisian citizenship and her Tunisian husband, two Jordanians, a Belgian national, a Kuwaiti citizen and a Canadian, according to those countries' governments and a diplomat. Jordan's Foreign Ministry earlier said three of its citizens had been killed, but revised that, saying there was confusion over the nationality of one victim.

A U.S. State Department official, who spoke only on condition of anonymity, said one American man was among those wounded. Turkey's minister for family and social policies, Fatma Betul Sayan Kaya, said citizens of Saudi Arabia, Morocco, Lebanon and Libya were among those injured.

NTV news reported that the assailant was wearing a Santa Claus outfit when he entered the nightclub on the shore of Bosporus straight, on the European side of the city – a claim Prime Miniser Binali Yidirim denied.

Sickening video from the scene shows what appeared to be a man dressed in black and carrying a backpack as he shoots down a police officer outside the nightclub. Footage taken by a different camera inside Reina shows a figure wearing different clothes and what could be a Santa Claus hat.

Yildirim said the attacker left a gun at the club and escaped by "taking advantage of the chaos" that ensued. Some customers reportedly jumped into the waters of the Bosporus to escape the attack.

Mehmet Dag, 22, said he was passing by the club when he saw a man shoot at a police officer and a bystander. He said the attacker then targeted security guards, gunning them down and entering the club.

"Once he went in, we don't know what happened. There were gun sounds, and after two minutes the sound of an explosion," Dag said.

Turkish media said the local victims included a 22-year-old police officer and a 47-year-old travel agent, both of whom were shot outside the club.

One was given a funeral Sunday in Istanbul, where his two sons joined the mourners gathered around the flag-draped casket, the private Dogan news agency reported.

Ayhan Arik, a tourism company employee who had taken foreign guests to the nightclub, was shot in the head, the news agency said.

On Sunday, heavily armed police blocked the snowy street in front of the nightclub. The entrance was covered with blue plastic sheeting below a Turkish flag. Police also patrolled the Asian side of the Bosporus on the other side of the club.

Crime scene investigators were seen inside the nightclub searching through mingled piles of chairs, tables and pieces of clothing left behind during the panic among the guests.

There were emotional scenes in front of a city morgue where the dead were taken for identification. Some relatives cried out and fell to the ground as they apparently learned the fate of their loved ones.

The Islamic State group claims to have cells in the country. Analysts think it was behind suicide bombings last January and March that targeted tourists on Istanbul's iconic Istiklal Street as well as the attack at Ataturk Airport in June, which killed 45 people.

In December, ISIS released a video purportedly showing the killing of two Turkish soldiers and urged its supporters to "conquer" Istanbul. Turkey's jets regularly bomb the group in the northern Syrian town of Al-Bab. Turkish authorities have not confirmed the authenticity of the video.

The nightclub attack drew quick condemnation from the West and Russia.

Russian President Vladimir Putin sent a telegram to Turkey's leader, saying that "it is hard to imagine a more cynical crime than killing innocent people during New Year celebrations."

"However, terrorists don't share moral values. Our common duty is to combat terrorists' aggression," Putin said.

The White House condemned what it called a "horrific terrorist attack" and offered U.S. help to Turkey. The U.N. Security Council condemned the "heinous and barbaric" assault in the "strongest terms."

The Associated Press contributed to this report.