"We are face to face with a terror attack," Interior minister Suleyman Soylu told reporters.
Twenty-one of the dead have been identified, he said. Of those, 16 were foreign nationals and five were Turkish.
US officials also called it a terrorist attack, making it the first of 2017.
- The death toll from the Reina nightclub shooting has risen to 39
- The number of injured is at 69; "Four of them are in critical condition -- one very critical," says Interior Minister
- At least one gunman still on the run -- it is unclear how many attackers were present
- No claim of responsibility has yet been made
- US, Turkish officials say incident is a terrorist attack
Soylu also said that "the efforts to locate the terrorist are ongoing. Security forces have begun the necessary operations. God willing soon (the attacker) will be apprehended."
Around 1:15 a.m. Sunday, the gunman shot a police officer who was guarding the front gate at the Reina nightclub, killing him, Istanbul Governor Vasip Sahin said.
"He entered the club and attacked innocent people who were there to celebrate the new year. It was a cruel, cold-blooded act," the governor said.
There have been no claims of responsibility. The fate of the attacker -- or attackers -- was also unclear.
'Crazy people shooting everything'
Witnesses in the club said they heard a loud noise, then a security officer told everyone to get out.
One victim said he didn't know how many attackers there were, but he saw one person and hid.
"I got shot in the (expletive) leg, man," he told journalists in English as he was taken into an ambulance. "These crazy people came in shooting everything."
A security camera captured the moment a gunman dressed in dark clothing dashed into the Reina nightclub as bullets ricocheted in the street.
The assailant, who has not yet been identified, opened fire inside the high-end nightclub in the busy Besiktas neighborhood, according to Turkish state-run news agency Anadolu.
Besiktas, on the European shore of the Bosporus, is known for its expensive, upper-middle class neighborhoods. The popular area had been under heavy police security for new year celebrations.
Ortakoy, where Reina is located, is a vibrant seaside neighborhood that caters to a wide range of people, from the uber-rich who party at clubs like Reina, to students who buy stuffed baked potatoes from vendors along the Bosporus.
Reina itself is one of the first clubs to open along the famous strait and remains a touchstone for Istanbul's exclusive nightlife. It boasts a classic Istanbul view.
Several analysts said the attack looked more like a jihadist-inspired attack.
"In terms of the soft-target aspects of this attack, it's a youthful place, a bar that's pretty well-known in particular to expats. It's sort of the lively area of Istanbul, and especially on New Year's Eve night -- all of those have hallmarks of ISIS-inspired, if not directed attacks to maximize casualties and get a lot of news around it," said Juliette Kayyem, CNN's national security analyst.
Turkey's recent tumult
Turkey has endured a recent wave of terrorist attacks, leaving many people wary.
"This attack is, of course, a horrible development, but not shocking to many Turks who chose to stay inside this New Year's Eve," said Aykan Erdemir, former member of the Turkish Parliament.
"Turkey is known to host these big parties to celebrate New Year's, but this year most citizens were wary of Islamist attacks so they chose to celebrate it at home with their friends."
He said the attack seemed similar to what happened at the Bataclan, a Paris concert hall that was attacked by gunmen in 2015.
"This is an attack on the Western lifestyle. This is an attack on Turkey's secular, urban way of living. And this will simply fuel the ongoing cultural clashes, the ongoing polarization in Turkey," Erdemir said.
The United States condemned the attack.
"That such an atrocity could be perpetrated upon innocent revelers, many of whom were celebrating New Year's Eve, underscores the savagery of the attackers," National Security Council spokesman Ned Price said in a statement.
The US State Department said the attacks like this one on its NATO ally "only reinforce our strong determination to work with the government of Turkey to counter the scourge of terrorism."
The US Embassy in Turkey warned citizens to avoid the area where the attack occurred.
A violent year
Turkey faces numerous battles across different fronts. Not only has the Syrian conflict and refugee crisis spilled over into Turkey, but Turkey is also battling ISIS and Kurdish militants.
Both have staged attacks in Turkey, which is still reeling from a bloody and failed military coup in July.
ISIS is suspected in a June attack at Istanbul's Ataturk Airport that left 44 people dead and an explosion at an August wedding, not far from the border with Syria, that killed at least 54 people.
Meanwhile, Turkish security forces clash on an almost daily basis with Kurdistan Workers Party (PKK) militants, mostly in predominantly Kurdish parts of southeastern Turkey.
A pair of bombings in Istanbul
killed 44 people and wounded 155 others December 10 in an attack by a breakaway group of the PKK. The two explosions occurred after a heavily attended soccer game at Besiktas Vodafone Arena.
On December 17, a car bomb exploded
near a public bus, killing 13 soldiers in the central province of Kayseri. Three days later, a gunman assassinated Russia's ambassador
to Turkey at an Ankara art gallery.