An Uzbek citizen who confessed to killing 39 people at an Istanbul nightclub in a New Year gun attack claimed by the Islamic State extremist group goes on trial in Istanbul on Monday.
Abdulkadir Masharipov faces 40 life sentences, one for each of the victims and the massacre itself, when the trial gets under way at the Silivri prison complex outside the centre of Istanbul.
A total of 57 suspects are due to go on trial, including Masharipov's wife Zarina Nurullayeva who is a suspected accomplice and risks similar penalties to her husband. All but six are being held in custody.
Masharipov was captured alive in a massive police operation and analysts say his evidence in confessions have helped Turkish authorities break up the elaborate network of jihadist cells in the city.
He is facing charges ranging from "attempting to destroy constitutional order", "membership of an armed terrorist organisation", to "murdering more than one person".
After taking a taxi to the elite waterside Reina nightclub on the shores of the Bosphorus, Masharipov shot dead the security guard before marching inside and firing indiscriminately with his AK-47 at the terrified revellers and setting off grenades.
With survivors even jumping into the Bosphorus in panic, Masharipov, 34 at the time of the attack, slipped away from the scene as he merged into the crowds, triggering fears he could strike again.
The IS extremist group, which at the time controlled swathes of Turkey's neighbours Iraq and Syria, later claimed the attack. It remains the only time it has issued an unequivocal claim for an attack in Turkey.
However, after a 17-day manhunt that involved 2,000 police who watched 7,200 hours of video footage, the Turkish authorities detained Masharipov in the residential Istanbul neighbourhood of Esenyurt.
Turkish authorities said Masharipov trained in Afghanistan and he confessed to carrying out the attack after receiving orders from the headquarters of IS in the Syrian city of Raqa.
According to the indictment, the order for the attack was given by a senior Russian Syria-based IS extremist named Islam Atabiev -- codenamed Abu Jihad.
Of the 39 killed in the Reina attack, 27 were foreigners including citizens from Lebanon, Saudi Arabia, Israel, Iraq and Morocco who had gone to the club to celebrate New Year. According to the indictment, 79 people were wounded.
Masharipov, who used the IS codename Abu Mohammed Horasani, was just one of several nationals of the ex-Soviet state of Uzbekistan implicated in jihadist attacks this year.
An Uzbek man in October used a truck to mow people down on a New York street, ultimately killing eight according to terror charges. An Uzbek national was arrested after a truck attack in Stockholm in April that killed four people.
The overwhelmingly Muslim Central Asian state was ruled since independence under the tight secular regime of Islam Karimov who clamped down on Islamist dissent and died in September 2016.
The majority of the other suspects on trial are also foreigners, including Uighur Chinese and other nationals of Central Asian states.
Turkey was in 2016 battered by repeated attacks by jihadist and Kurdish extremists. However, there has been no further large-scale attack comparable to the Reina atrocity since.
Istanbul and Ankara remain under the tightest security and the authorities repeatedly claim that major plots have been foiled and hundreds of jihadist suspects detained.
Badly damaged in the attack, the Reina nightclub, once the haunt of Istanbul football stars and soap opera icons, was demolished in May on the grounds it had violated local construction legislation.
Turkey under President Recep Tayyip Erdogan had been accused by its Western allies of not doing enough to halt the rise of IS.
But the charges are denied by the Turkish authorities, who note the group has been listed as a terror organisation in the country since 2013.