This article examines the role played by gambling in the articulation of communal identity amongst Turki-speakers (“Uyghurs”) in late-Qing and early Republican Altishahr (southern Xinjiang), focusing on a text from Yarkand titled “The Gambler’s story.” Portraying gambling as a fundamentally alien practice used by “Khitay” (Chinese) to exploit and undermine communal solidarity, the text defines its audience community in opposition to two more clearly demarcated and threatening communities: Khitay, and local gamblers, both of whom it seeks to exclude. The text thus indicates that Turki-speaking inhabitants of Altishahr in the late Qing and early Republic sought to enforce communal discipline by ethnicizing deviant behavior (ironically mirroring orientalizing discourses employed by Qing officials and European observers). Such an approach, while simplifying a more complex reality, helped lay a basis for subsequent Uyghur nationalism by sharpening communal boundaries and excluding behavior harmful to perceived common economic interests.