A rights activist in Kazakhstan who faced seven years imprisonment over his outspoken opposition to neighbouring China was unexpectedly freed on Friday as public and international pressure over his case mounted. Serikjan Bilash, whose activism in defence of Muslim and Turkic minorities in Xinjiang earned him global media attention, said he struck a plea bargain with the court that allowed him freedom but will end his activism. “I had to end my activism against China. It was that or seven years in jail. I had no choice,” Bilash said at a restaurant where he held a celebratory midnight feast with his family and about 40 supporters. Bilash agreed to accept guilt over inter-ethnic incitement charges triggered by his call for an “information Jihad” against the Chinese authorities over their policies in Xinjiang earlier this year. He will also be unable to leave the city of Almaty – Kazakhstan’s largest – for the next three months under the terms of his deal, he said. “I had to do this for my family and my children,” he told said as supporters in high spirits drank tea and chowed down on a traditional meat-and-potato dish. Xinjiang Uygurs didn’t choose to be Muslims, China says His release capped a dramatic night in Almaty, where some 200 hundred supporters surrounded the court where Bilash appeared and chanted for his freedom. His lawyer Aiman Umarova had sounded the alarm earlier in the evening as she was unable to make contact with Bilash who had arrived at the courthouse before her and was immediately taken in by authorities. Umarova refused to sign the plea bargain, insisting on her client’s innocence, meaning Bilash had to find another lawyer to sign off on the deal. “I refuse to put my name to any deal that was signed under pressure,” Umarova said. Bilash had previously been held under house arrest after being detained and flown to the capital Nur-Sultan in March. Critics connected his arrest to pressure from Kazakhstan’s economically powerful neighbour. The Communist Party’s dragnet in Xinjiang has swept up an estimated one million ethnic Uygurs and other mostly Muslim minorities into “vocational education centres” that numerous studies and reports say are harsh internment camps. Trump hears ‘tough’ Xinjiang camp details from detained Tohti’s daughter With a population of at least 1.5 million, Kazakhs are the second largest Turkic group in Xinjiang after the Uygurs. In July a court in Nur-Sultan ruled to transfer his case to Almaty, where the family of Bilash – an ethnic Kazakh who was born in Xinjiang but obtained Kazakh citizenship as an adult – are based. Fiery orator Bilash had told the court Beijing was perpetrating a “genocide” against Turkic minorities in Xinjiang while “Chinese soft power” was working to “occupy our minds” in the Central Asian state. Kazakhs living in Kazakhstan have used Bilash’s informal rights group Atajurt to appeal to the Kazakh government to lobby China for their relatives’ release. Some supporters gathered outside the courthouse sporting T-shirts advertising a bid to nominate Bilash for the Nobel Peace Prize were former residents of Beijing’s notorious centres in the region. Earlier this month, a man who returned to Kazakhstan after spending a year-and-a-half trapped in Xinjiang said he believed Bilash’s activism had forced his release. “Without Serikjan and Atajurt, I would not be here,” said Tursynbek Kabiuly, who had his passport confiscated and was interrogated for six consecutive days in a jail after crossing into China to attend a relative’s funeral. A valiant effort to show ‘forgotten’ Uygurs’ plight Kazakhstan’s foreign ministry has engaged in quiet diplomacy with major trade partner China on Xinjiang but has been reluctant to promote its efforts given sensitivities over Xinjiang. Last year the ministry said China had allowed 2,500 ethnic Kazakhs to leave the country and enter Kazakhstan “as a kind gesture” but refused requests for further information. Kazakhstan, an oil-rich, landlocked country of 18 million people has positioned itself as the “buckle” in President Xi Jinping’s flagship belt and road international infrastructure drive.