ANKARA, Turkey -- Turkish police rounded up 27 people linked to the suspected gunman in Istanbul’s New Year’s Eve nightclub attack and the justice minister said Wednesday that the capture of the suspect will lead to a better understanding of the Islamic State of Iraq and Syria’s (ISIS) operations in Turkey.

The suspect, identified as 34-year-old Abdulkadir Masharipov, was caught late Monday in a police operation in Istanbul. Authorities identified him as an Uzbek national who trained in Afghanistan and staged the attack for ISIS.

ISIS claimed responsibility for the attack that killed 39 people. Turkish authorities say the suspect has confessed.

Get Breaking News Delivered to Your Inbox

Justice Minister Bekir Bozdag told the state-run Anadolu Agency that the arrest would reveal “important information” on ISIS’ modes of operation and increase the government’s ability to thwart attacks. He said there was no doubt the attack was the work of ISIS.

Anadolu said Turkish anti-terrorism squads had raided seven addresses in simultaneous operations in the northwestern city of Bursa, arresting 27 suspects from Tajikistan, Uzbekistan, Kyrgyzstan as well as from China’s minority Muslim Uighur community. Fifteen of them were women.

Police also took 29 children into protective custody and seized 40 passports and 15 mobile phones set up with fake identity cards found at an empty house.

Anadolu said that address was connected to a Tajik national identified by the initials of M.S. The report described him as an ISIS facilitator for foreign nationals.

Other Turkish media reports fleshed out details about the alleged killer and his ISIS-sanctioned mission on the night of Dec. 31.

The Hurriyet Daily News, citing security sources, said the Istanbul shooter had received orders directly from Raqqa, the ISIS’ self-declared capital in Syria.

The report, citing Turkish authorities and police investigations, said the original target of the attack was Istanbul’s famous Taksim Square. But the plan was modified in response to boosted security there, according to the report, which cited an account of events allegedly given by the suspect.

Masharipov reportedly arrived into Turkey on Jan. 16, 2016, through Iran after receiving orders to join the war in Syria. He initially settled in the central Turkish city of Konya.

“While there, I received the order from Raqqa ... to carry out an attack on New Year’s Eve in Taksim,” he was quoted as saying in the Hurriyet report.

In preparation, Masharipov travelled to Istanbul on Dec. 16, staying first at an ISIS house in the neighborhood of Basaksehir.

But on New Year’s Eve, he was quoted as saying it didn’t seem possible to carry out the attack in Taksim due to intense security measures. Masharipov then contacted his handler, who told him to find a new target. He spotted the Reina night club at 10 p.m. while traveling by taxi on the banks of the Bosporus.

He suggested the new target to his handler, who approved. The alleged shooter then went to collect his weapon from the neighborhood of Zeytinburnu, where he went two days before the attack.

The gunman took out a security guard outside of the nightclub and another civilian before entering Reina and letting loose a salvo of bullets on people who were celebrating New Year’s Eve.

Turkish officials say the attacker, who switched clothes at the nightclub, melted into the crowd of survivors and escaped the premises.

The Hurriyet report claimed police came close to apprehending Masharipov the day after the attack, spotting him on the back seat of a car. Police were fired on and the suspect escaped.

Foreign currency and various documents are seen in the bedroom of a hideout where the alleged attacker of Reina nightclub was caught by Turkish police, in Esenyurt neighbourhood in Istanbul, Turkey, Jan. 17, 2017. REUTERS

He reportedly arrived at the address where he was apprehended, a luxury residence in the Istanbul neighborhood of Esenyurt, on Jan. 6. An Iraqi man, the renter of the apartment, and three women were caught in that operation. The women allegedly planned to join ISIS and did the shopping.

Masharipov had received arms training from al Qaeda in Iraq, according to Hurriyet. That group morphed into ISIS, with leader Abu Bakr al-Baghdadi retaining control, in the years after the U.S.-led invasion of Iraq and the subsequent foreign military drawdown there.

Turkish officials have said he trained in Afghanistan.

Turkey’s private Dogan news agency, citing security sources, said Masharipov had studied physics in Uzbekistan.