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 "foreign guests."
The attacker, armed with a long-barreled weapon, killed a policeman and a civilian outside Istanbul's popular Reina club at around 1:15 am before entering and firing on people partying inside, Governor Vasip Sahin said.
"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," Sahin told reporters.
There was no immediate claim of responsibility for the attack and authorities did not name any suspects. The bloodiest attacks that Turkey endured in 2016 were the work of the ISIS group or Kurdish militants.
Turkey is a member of NATO and a partner in the US-led coalition against the ISIS. The country is also facing renewed conflict with Kurdish rebels in the southeast, and across the border in Syria and Iraq.
Interior Minister Suleyman Soylu said the attacker has not been identified and is still at large. "Our security forces have started the necessary operations. God willing he will be caught in a short period of time," he said.
Private NTV news channel said the assailant entered the upscale nightclub, on the shores of the Bosporus, on the European side of the city, dressed in a Santa Claus outfit. The minister said the lone attacker was believed to have left the club wearing different clothing.
At least 15 of the dead were foreign nationals, Soylu said, without providing information on their nationalities. Five of the victims were identified as Turkish nationals while authorities were still trying to identify the rest. At least 69 people were being treated in hospitals, four in serious condition, Soylu said.
Three or four of the Turkish victims may have been employees at the nightclub, he said.
"This was a massacre, a truly inhuman savagery," Soylu said.
Some customers jumped into the waters of the Bosporus to escape the attack, the NTV report said.
Mehmet Dag, 22, was passing by the club and saw the suspect shoot at a police officer and a bystander. He said the suspect then targeted security, 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."
IPhone footage filmed by Dag and obtained by The Associated Press showed a police officer lying on the ground outside the club, and then a woman. Dag told the woman, who was lying on the floor face down in a pool of blood, "my sister, you will get better." He called for an ambulance. Footage showed ambulances and the lights of an Istanbul bridge when the sound of gunfire rang out inside the club.
Sinem Uyanik was inside the club with her husband, who was wounded in the attack.
"Before I could understand what was happening, my husband fell on top me," she said outside Istanbul's Sisli Etfal Hospital. "I had to lift several bodies from on top of me before I could get out. It was frightening." Her husband was not in serious condition despite sustaining three wounds.
The nightclub area remained sealed off on Sunday morning.
Heavily armed police blocked the snowy street in front of the nightclub where the entrance was covered with blue plastic sheeting below a Turkish flag. Police patrolled the Asian side of the Bosporus on the other side of the club.
And there were emotional scenes in front of a city morgue where those shot dead were brought for identification. Some relatives cried out and fell to the ground as they apparently learned the fate of their loved ones.
Major attacks carried out by ISIS or Kurdish militants killed more than 180 people in Istanbul and Ankara alone in 2016.
On December 10, a double bomb attack outside a soccer stadium near the Reina nightclub killed 44 people and wounded 149 others. The attack was claimed by Turkey-based Kurdish militant group, the Kurdish Freedom Falcons.
Nine days later, an off-duty Turkish riot policeman assassinated Russian Ambassador Andrei Karlov at a photo exhibition in the capital, Ankara. The government has suggested that a movement led by US-based Muslim cleric Fethullah Gulen was behind the killing - an accusation the cleric has denied.
"Turkey continues its combat against terror and is absolutely determined to do whatever is necessary in the region to ensure its citizens safety and peace," said President Erdogan in a written statement Sunday.
The nightclub attack drew quick condemnation from the West and Russia.
Russian President Vladimir Putin sent his Turkish counterpart a a telegram of condolences, saying "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 US Consulate General in Istanbul reminded US citizens "that extremist groups are continuing aggressive efforts to conduct attacks in areas where US citizens and expatriates reside or frequent."
European Union foreign policy chief Federica Mogherini tweeted: "Our thoughts are with victims and their loved ones. We continue to work to prevent these tragedies."
An estimated 600 people were celebrating inside the club that is often frequented by famous locals, including singers, actors and sports stars. Several shocked revelers were seen fleeing the scene after the attack and the music fell silent.
The prime minister's office issued a media blackout on the events and asked media to refrain from broadcasting and publishing anything that may cause "fear in the public, panic and disorder and which may serve the aims of terrorist organizations."
Security measures had been heightened in major Turkish cities, with police barring traffic leading up to key squares in Istanbul and the capital Ankara. In Istanbul, 17,000 police officers were put on duty, some disguised as Santa Claus and others as street vendors, Turkey's Anadolu news agency reported.