Turkish security forces on Monday detained Uzbekistan national Abdulgadir Masharipov who is suspected of having shot dead 39 people celebrating the New Year at Reina, a popular Istanbul nightclub.
He was captured in an apartment in Esenyurt district of Istanbul with his four-year-old son.
Turkey's police and its intelligence agency, MIT, carried out the operation to capture him.
Four other people, including a man of Iraqi origin and three women, were detained along with Masharipov.
Istanbul Governor Vasip Sahin on Tuesday said the suspect had admitted to the crimes after his fingerprints were matched to the ones found in the nightclub.
Sahin said the suspect entered Turkey illegally from the eastern border of the country in January 2016.
He thanked security forces who had gone through 7,200 hours of CCTV footage from around the city.
According to Sahin, the suspect had reportedly been operating under the cover name Abu Muhammed Horasani.
Reports had previously suggested he never left the metropolis. A tightening of borders had been put in place in a bid to stop him escaping.
Daesh claimed responsibility for the attack in which dozens were also injured.
TRT World's Soraya Lennie reports from Istanbul.