Media reports say Uzbek national Abdulkadir Masharipov was handed 40 life sentences without parole after 39 killed in Istanbul attack.

A Turkish court sentenced to life in prison the main suspect in a gun attack at an Istanbul nightclub on New Year's Day in 2017 in which 39 people were killed.

Turkey's state-owned Anadolu Agency (AA) says Abdulkadir Masharipov, an Uzbek national, was given the equivalent of 40 life sentences without parole on Monday, plus an additional 1,368 years in prison, Police detained Masharipov on January 17, 2017, and said he acted on behalf of the ISIL (ISIS) terror group that claimed responsibility for the attack, saying it was revenge for Turkish military involvement in Syria.

The Reina nightclub shooting was one of a string of attacks in Turkey believed to have been carried out by ISIL.

Several revelers reportedly jumped into the waters of the Bosporus to escape the attack.  Most of the dead were foreigners.

Masharipov previously repudiated statements to police in which he admitted guilt for the attack, and disputed the evidence against him, saying he was not the person photographed holding an assault rifle in the club.

The attacker opened fire in the nightclub with an assault rifle, throwing stun grenades to allow himself to reload and shooting the wounded on the ground.  Victims included Turks, Arabs, Canadians and Indians.  

The same court sentenced a second man, Ilyas Mamasaripov, who is believed to have helped plan the attacks, to more than 1,400 years for assisting murderer and attempted murderer and aiding the violation of the constitution, AA reported. 

It said 48 other defendants were sentenced to jail terms of varying lengths for membership in a terrorist organization.  Eleven other defendants were reportedly acquitted of all charges.