So-called Islamic State says it was behind the new year attack on a Turkish nightclub that killed 39 people.
The group said in a statement it was carried out by ‘a heroic soldier’.
At least 600 revellers were celebrating in the early hours of Sunday at Istanbul's Reina nightclub when the gunman began firing indiscriminately.
IS has been blamed for recent attacks in Turkey, which is taking military action against the group in neighbouring Syria.
The extremist group has already been linked to at least two attacks in Turkey last year.
More details of the nightclub attack have been emerging. The gunman fired up to 180 bullets, Turkish media report.
He arrived by taxi before rushing through the entrance with a long-barrelled gun he had taken from the boot of the car.
The attacker fired randomly at people, starting with a security guard and a travel agent near the entrance. Both were killed.
The assault lasted seven minutes and the gunman is reported to have removed his overcoat before fleeing during the chaos.
A manhunt is under way, interior minister Suleyman Soylu confirmed. ‘We hope the attacker will be captured soon.’
President Recep Tayyip Erdogan accused groups such as IS of trying ‘to create chaos’.
‘They are trying to... demoralise our people and destabilise our country,’ he added.
Turkey suffered a bloody 2016 with a series of attacks, some carried out by Kurdish extremists.
But a day before the IS claim, the banned Kurdistan Workers' Party was quick to distance itself from the nightclub attack, saying it would ‘never target innocent civilians’.
At least 25 of those killed were foreign, according to local media, among them citizens from Israel, Russia, France, Tunisia, Lebanon, India, Belgium, Jordan and Saudi Arabia.
Security guard Fatih Cakmak was among the first to die.
His brother said he narrowly escaped a double bombing three weeks ago, having been on duty when Kurdish extremists launched an attack near a football stadium, killing at least 44 people, mostly police.
At least 69 people are being treated in hospital, officials said, with three in a serious condition.
The nightclub, which sits on the banks of the Bosphorus, is one of Istanbul's most fashionable venues - popular with foreigners and often frequented by singers and sports stars.
Istanbul was already on high alert with some 17,000 police officers on duty in the city, following a string of terror attacks in recent months.
Want stories like this in your inbox?
Sign up to exclusive daily email
More Stories from Europe