A suspect wanted for the massacre of 39 people at a popular Istanbul nightclub on New Year's Day has been captured in Istanbul, state-run media in Turkey reported.
Abdulkadir Masharipov, also known as Abu Muhammed Horasani, was detained in Istanbul's district of Esenyurt, the Dogan News Agency reported. His 4-year-old son was with him.
He will undergo a health evaluation before being brought to officials, Hurriyet reported.
On Tuesday, Istanbul's Governor Vasip Sahin said Masharipov's fingerprints matched those of the attacker and that he had confessed to carrying out the shooting. Sahin said it was clear that ISIS was behind the attack, the Associated Press reported.
Sahin said Masharipov is an Uzbekistan national who trained in Afghanistan. He is believed to have entered Turkey in January 2016.
The massacre happened inside the nightclub Reina.
ISIS released a statement shortly after the attack claiming responsibility.
The ISIS-linked Aamaq News Agency said the attacker was a "heroic soldier of the caliphate who attacked the most famous nightclub where Christians were celebrating their pagan feast."
The statement said the gunman opened fire with an automatic rifle in "revenge for God's religion and in response to the orders" of ISIS leader Abu Bakr al-Baghdadi.
At least 69 more were injured in the attack, which took place at the crowded club amid New Year's celebrations.
The gunman first encountered a police officer at the door to the club and killed the officer, Sahin said at the time. The attack then moved inside the club, where some witnesses said they saw two or three attackers.
Of the dead, 21 people had been identified by Sunday morning. Twenty-four of those killed were foreigners.
The government's Forensic Medicine Institute said the nationalities of the dead foreigners included seven Saudis, two Indians, one Canadian, one Syrian, one Israeli, two Tunisians, four Iraqis, three Lebanese, and one Belgian national, reported the Dogan News Agency.
The club overlooks the Bosphorus strait, and some people jumped into the sea to flee, CNN reported.
William Jacob Raak, an American businessman, told NBC News he played dead even though he was shot during the attack.
The Dogan News Agency obtained video showing the gunman firing his rifle as he entered the club.
CCTV footage obtained by the Associated Press seems to show the attacker wearing a Santa Claus hat for part of the attack.
The footage showed the male assailant dressed in black and carrying a backpack as he shoots a police officer outside club. And footage taken by a different camera inside the venue appeared to show the gunman wearing different clothes and a Santa Claus hat.
But Turkey's Prime Minister Binali Yildirim rejected reports the gunman was dressed as Santa.
"There's no grounds to the terrorist being dressed as Santa," he said. "He is just an armed terrorist."
Talking to reporters, Yildirim said the attacker made his way into the club after killing a security guard and officer at the door.
"He gets inside and kills people by shooting trigger-happy," he said. "Then he leaves his weapon at the scene and gets away using the pandemonium."
Days after the attack, Turkey's President Recep Tayyip Erdogan released a written statement of condemnation.
"Those who target our peoples' peace and their agents are trying to destabilize our country and demoralize our people to create chaos by despicable attacks that target even civilians. But us, by not betraying our nation's calmness and by uniting more closely, we will not let these dirty games come to pass," he said.
"Turkey, which is persisting on its efforts against terror, is set on doing whatever that needs to be done in the region to ensure the security and the peace of its citizens. We are well aware that these attacks perpetrated by various terror groups that target our country are not independent of the events happening in our region."
One woman said her husband was in surgery after being shot three times. "It was terrifying," Sinem Uyanik told Hurriyet. "One gunman was shooting trigger-happy."
She added she saw one gunman with an assault rifle as well as two others shooting with handguns.
"It smelled like gunpowder," she told Hurriyet. "I fainted. Then regained consciousness. My husband was covered in blood. People were covered in blood. Then we called for an ambulance and police."
Police and special forces then arrived, telling victims to stay on the ground as they searched for the attackers, she said. They were then allowed to leave and seek medical attention.
The club's owner told Hurriyet that US intelligence had warned of the possibility of an attack, and Turkey's Coast Guard had been involved in taking security measures around the seaside club over the last week.
"Then what happened? This attack happened right before our eyes," owner Mehmet Kocarslan told Hurriyet.
The US Embassy in Turkey issued a statement Sunday saying the threat warning issued on Dec. 22 was a general holiday warning to Turkey and parts of Europe, and that the US agencies did not have information about a specific threat.
"Contrary to rumors circulating in social media, the US Government had no information about threats to specific entertainment venues, including the Reina Club, and the US Government did not warn Americans to stay away from specific venues or neighborhoods," the statement read.
US and Turkish officials have and continue to share information about terror threats, the statement read.
Immediately after the attack, local television stations reported that a gunman remained inside. But by 3:30 a.m., authorities began to leave the scene and the gunman appeared to have fled.
Another security video obtained by the Dogan News Agency appeared to show the attacker inside the club.
And a security video apparently shows the moment the attack began. A person dressed in black runs toward the club entrance as bullets ricochet off cars; one person can be seen falling to the ground.
This earlier footage of the alleged shooter also emerged, showing him reportedly getting his passport checked:
Santa costumes have become a part of New Year's celebrations in Turkey; in Istanbul, plainclothes police have taken to wearing red hats and beards over the holiday to blend in with New Year's crowds.
The Christmas symbols have at times drawn criticism from some as inappropriate for Muslims to embrace.
Hundreds of people were reportedly inside the club at the time of the attack, and the area had drawn large crowds to celebrate the new year.
Turkey's justice minister condemned the attack as terrorism and vowed to punish the perpetrators.
US President Barack Obama was briefed on the attack and offered assistance to Turkish authorities as necessary, a White House statement said. National Security Council spokesman Ned Price added that the US condemned the attack as terrorism.
"That such an atrocity could be perpetrated upon innocent revelers, many of whom were celebrating New Year's Eve, underscores the savagery of the attackers," Price said in a statement. "We offer our thoughts and prayers to the families and loved ones of those killed, and a speedy recovery to the wounded."