The main suspect in a New Year's Day 2017 shooting attack that killed 39 people at an Istanbul nightclub denied the charges against him in court on Monday, Turkey's state-owned Anadolu news agency reported. Abdulkadir Masharipov, an Uzbek national, was captured on January 17, 2017 by police who said he had acted on behalf of ISIS. The militant group admitted the attack, saying it was revenge for Turkish military involvement in Syria. Mr Masharipov was one of 58 defendants, 39 of whom are in detention, on trial in an Istanbul court on Monday over the assault at the exclusive Reina nightclub. The attacker opened fire with an automatic rifle, throwing stun grenades to allow himself to reload and shooting the wounded on the ground. Victims included Turks, Arabs, Canadians and Indians. Mr Masharipov repudiated his previous statements to police in which he admitted guilt, and disputed evidence against him, saying he was not the person photographed holding an assault rifle in the club, Anadolu said. He blamed the media for linking him to the attack, and said he hid after he saw the photos attached to his name because he did not have identification papers, Anadolu said. The court ordered the release of 19 of the defendants pending trial, banning them from travelling abroad, Anadolu said. Masharipov was not among those to be released. The next session of the trial will be held on May 16. The Reina nightclub shooting was one of a string of attacks in 2017 believed to have been carried out by ISIS and also by Kurdish separatist militants.