A man suspected of killing 39 people in a New Year's Day attack on a popular Istanbul nightclub has been caught by police, according to Turkish news media.

The alleged gunman, identified as Abdulgadir Masharipov, was captured in an apartment in Istanbul's Esenyurt district during a massive police operation late on Monday, security sources told state-run Anadolu Agency.

READ MORE: Istanbul nightclub attack aims to create chaos, says Erdogan

Four other people, including a man of Kyrgyz origin and three women, were reportedly arrested with Masharipov.

The Islamic State of Iraq and the Levant (ISIL) group claimed responsibility for the attack on the Reina nightclub, saying it was revenge for Turkish military involvement in Syria.

Al Jazeera's Sinem Koseoglu, reporting from Istanbul, said dozens of people had previously been arrested in connection to the attack.

"We know that [Masharipov] is an Uzbek citizen," she said. "When his wife was [previously] arrested, she said she had no clue, no information, that her husband was an ISIL sympathiser."

Early on January 1, the assailant stormed the popular venue on the Bosphorus and sprayed 120 bullets at partygoers celebrating the start of 2017.

Of the 39 dead, 27 were foreigners, including citizens from Lebanon, Saudi Arabia, Israel, Jordan, Iraq, Tunisia and Morocco.

At least 69 people were wounded in the attack.