A manhunt was on in Turkey for at least one assailant who shot dead 39 people in a crowded Istanbul nightclub during New Year's celebrations and fled the scene.
About 70 others were wounded, three of those people in critical condition, Binali Yildirim, Turkey's prime minister, said on Sunday.
Interior minister Suleyman Soylu described the attack as a "massacre, a truly inhumane savagery".
"Our security forces have started the necessary operations. God willing, he will be caught in a short period of time," Soylu said.
Police said the gunman was in his mid-20s and spoke in broken Turkish.
The attacker, armed with a long-barreled weapon, killed a policeman and a civilian outside the popular Reina nightclub at around 1:15am before entering and opening fire on people partying inside, Istanbul governor, Vasip Sahin said.
Yildirim said the attacker left a gun inside the venue and escaped by "taking advantage of the chaos" that ensued.
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 Islamic State of Iraq and the Levant (ISIL) or outlawed Kurdish fighters.
President Recep Tayyip Erdogan vehemently condemned "the terror attack in Istanbul's Ortakoy neighbourhood in the first hours of 2017" and offered condolences for those who lost their lives, including "foreign guests".
Of the 21 dead identified so far, 15 were foreigners. Nationals of Saudi Arabia, India, Morocco, Israel, Lebanon, Belgium and Libya were among those killed, authorities said.
READ MORE: Reina nightclub - Party hotspot of Istanbul's elite
On Sunday, heavily armed police blocked the street in front of the nightclub in the Ortakoy neighbourhood as crime scene investigators were inside searching through piles of chairs, tables and pieces of clothing left behind by partygoers during the attack.
The Reina lies on the shore of the Bosphorus Strait and is one of Istanbul's best-known nightclubs, popular with locals and tourists alike. Turkish police boats patrolled the Asian side of the Bosphorus, on the other side of the club.
At least 500 people were thought to have been inside when the attack happened.
NTV broadcaster said the gunman fired between 120 and 180 rounds in the seven-minute attack, during which many revellers threw themselves into the freezing waters of the Bosphorus to escape death.
Al Jazeera's Sinem Koseoglu, reporting from Istanbul, said security services believe the timing and target suggest ISIL involvement. Eight ISIL members had been detained, suspected of preparing a suicide attack on New Year's Eve, she said.
The Reina nightclub is not only frequented by partygoers, but also used as a venue by businessmen and diplomats to conduct meetings, she added.
Koseoglu said those in the club reported seeing up to three attackers carrying Kalashnikov assault weapons.
A witness quoted by the Hurriyet newspaper said she had seen two attackers.
"Two people were shooting with weapons," she said. "Suddenly, people started to run. My husband told me not to be afraid. He jumped on top of me. People ran over me. My man was shot in three places."
Turkey, part of the US-led coalition against ISIL, faces multiple security threats, including fallout from the war in neighbouring Syria.
It has seen repeated attacks and bombings blamed on ISIL as well as fighters from the Kurdistan Workers' Party (PKK) in recent months.
READ MORE: Erdogan - Istanbul nightclub attack aims to create chaos
The PKK and its affiliates are known to target mostly members of Turkey's security forces rather than civilians.
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 organisations".
Security measures had been heightened in major Turkish cities, with police barring traffic leading up to key squares in Istanbul and 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.
Source: Al Jazeera and news agencies