— -- The suspect in the New Year's Eve attack on an Istanbul nightclub that killed 39 people confessed after being captured by police on Monday, the governor of Istanbul said at a press conference on Tuesday.
The suspect, an Uzbekistan native born in 1983, was identified as Abdulgadir Masharipov. Masharipov carried out the attack on behalf of the terror group ISIS, said the governor, Vasip Sahin.
Police picked up Masharipov in one of five raids carried out on Monday in and around Istanbul.
The alleged attacker was caught with his son in the Esenyurt suburb of Istanbul, sources said. He was arrested at the home of a friend, who was also detained. Three women were also in the house, which Turkish police believe may have been an ISIS cell, according to sources.
Masharipov had two guns and cash in his possession at the time of arrest, and police say his fingerprints matched those found at the scene of the massacre.
Officials believe Masharipov received training in Afghanistan and that he entered Turkey in January 2016.
Authorities said the gunman fired 180 rounds of 7.62-mm bullets, which are commonly used in AK-47 assault rifles. The attacker also used flares to illuminate the inside of the nightclub during the attack, according to police.
Police said they don't believe the weapon used in the attack came from inside Turkey. The serial number on the weapon had been defaced.
Between 400 and 500 people were in attendance at the Reina nightclub to ring in the new year. ISIS claimed responsibility for the attack, which was in response to Turkey's military operations against the group, ISIS propaganda channels said in a statement.
The gunman allegedly killed a policeman and a civilian outside the Reina nightclub before he began to shoot in a "cruel and merciless way on innocent people," said Vasip Sahin, the governor of Istanbul. Most of the victims were shot at close range or took bullets directly to the head, according to a report from the morgue.
ABC News' Michael Edison Hayden contributed to this report.