Turkish police captured the gunman who carried out the deadly New Year's nightclub attack in Istanbul, with officials saying Tuesday that he's an Uzbekistan national who trained in Afghanistan and confessed to the massacre, AP reports.

Istanbul governor Vasip Sahin said that the suspect is an Uzbekistan national who trained in Afghanistan. He is believed to have entered Turkey in January 2016. Sahin identified him as Abdulkadir Masharipov, saying he was born in 1983 without giving an exact birthday. Turkish media have reported the suspect's first name as Abdulgadir.

Sahin said that the man, captured late Monday, confessed to carrying out the massacre and that his fingerprints matched those of the attacker. He can be held for up to 30 days under Turkey's state of emergency, which was introduced after a failed coup attempt in July, before he is charged and formally arrested. It could take prosecutors several months to prepare for a trial.

The suspect, according to Sahin, was a well-educated terrorist who speaks four languages and had clearly carried out the attack in the name of IS. He was operating under the alias "Ebu Muhammed Horasani."

The police operation to apprehend him drew on the review of 7,200 hours of security camera footage and about 2,200 tipoffs from the public. Police searched 152 addresses and 50 people were taken into custody.

Authorities seized nearly $200,000, two guns and two drones during the suspect's arrest.

"Together with the terrorist, an Iraqi man was detained as well as three women from various countries — from Egypt and from Africa," Sahin said. "There is a high chance that they may be connected (to IS) because they were staying in the same house."

Anadolu said police have also carried out raids on members of a suspected Uzbek IS cell in five Istanbul neighborhoods, and detained several people.

Photographs from raids, widely published in the Turkish media, showed a bruised, black-haired man in a gray, bloodied shirt being held by his neck. NTV television said the gunman had resisted arrest.

Hundreds of people were gathered at the swanky Reina nightclub to celebrate the end of a tumultuous 2016 only to become the first victims of 2017. The gunman shot a police officer and a civilian outside the club, before storming the club. He killed 39 people and wounded over 70 persons, most of them are still in the hospital.

Source: AP