Abdulgadir Masharipov was arrested late Monday in a police raid on an address in the Esenyurt district on the northwestern outskirts of Istanbul.

Governor Vasip Sahin described Masharipov as a “1983-born Uzbek citizen” who “was trained in Afghanistan”. He did not say when the suspect was believed to have been in Afghanistan.

Masharipov had confessed the attack and his fingerprints matched those found at the scene, Sahin added.

The attack on the Reina nightclub left 39 dead and 69 injured when a gunman armed with an assault rifle stormed the venue beside the Bosphorus just over an hour into the New Year.

In the days after the attack, images of a man identified as the suspect emerged showing him filming himself in Istanbul before the attack.

“It is clear that this attack was carried out in the name of Daesh,” Sahin said at a news briefing outside Istanbul security headquarters.

He said Masharipov is thought to have entered Turkey in January last year. “His code name is Abu Mohammed Horasani Abdulkavi,” Sahin told reporters. “He was trained in Afghanistan, knows four languages -- a well-trained terrorist.”

The governor said Masharipov rented accommodation in the Basaksehir district after arriving in Istanbul and moved once or twice in the days leading up to the attack.

Talking about Monday’s raid, Sahin added: “The police investigated five different addresses on Monday and in the afternoon they intensified the operation and caught him at one of those addresses.”

Four people were arrested with Masharipov -- an Iraqi man and three women of “Egyptian and African origin”. Sahin added: “There is a strong possibility that they also are connected to a terrorist organization.”

Two handguns, $197,000 in cash, two aerial drones and SIM cards were seized in the raid on the Esenyurt raid.

The investigation into the attack has involved 2,000 police officers and 2,700 hours of camera footage have been examined. More than 150 locations have been searched and 50 people arrested in connection with the attack.

The investigation has been conducted in coordination with police special forces in Konya, Hatay and Izmir, Sahin said.

President Recep Tayyip Erdogan later mentioned the arrest in a speech in Ankara. “Nobody will get away with what they have done in this country,” he said. “The capture of the terrorist is a sign of it.”

Anadolu Agency