Manichaeism was persecuted almost everywhere it went. It was proscribed in the Roman empire, hunted in Sasanian Persia where it began, and periodically suppressed in China. The Uyghur Khaganate on the Mongolian steppe is the single exception: for something over seventy years from the 760s, the religion of Mani was the religion of a state.
The decision belongs to Bogu Khagan. He had taken Uyghur forces into China to help the Tang court recover from the rebellion of An Lushan, and at Luoyang in the early 760s he encountered Manichaean teachers, most of them Sogdians from the trading network that ran along the routes through Central Asia. He took several of them back with him and made the religion official.
The practical consequences were considerable. Manichaeism required its elect to abstain from meat and from agricultural labour, which is not an obvious fit for a nomadic economy, and their support fell on the hearers. The Sogdian merchants who carried the religion also carried literacy, and the Uyghurs took up a script derived from Sogdian that later passed to the Mongols. When the khaganate fell in 840 and the Uyghurs moved south-west into the Tarim basin, the religion went with them, and it is the Turfan oasis that has since yielded most of the Manichaean literature surviving anywhere in the world.