This paper treats birthday rituals and operatic performances staged for gods known as the Three Kings (Sanwang 三王) in northern Guangxi villages during the late Qing and Republican periods. The paper's goal is to explore the mediating roles of these events during the interaction between imperial rituals and indigenous cultural traditions. After the Guzhou Man 古州蠻 of Wangjiang 王江 submitted to the rule of the Northern Song Dynasty, the Three Kings were granted imperial titles and became a vital symbol of the alliance between state authority and local power. The imperial state further consolidated its rule following the Huaiyuan Yao Rebellion 懷遠猺亂 of the sixteenth century and the dredging of the Duliu River 都柳江 during the eighteenth century, with education and the local economy becoming increasingly developed. This time period witnessed the appearance of a native lower gentry, which emerged in large numbers in Heli 和里 and Nanzhai 南寨. These elites worked to reconstruct ritual and dramatic traditions for the Three Kings, introducing state-sanctioned rites such as the Three Sacrifices Ceremony (Sanxianli 三獻禮) into the villages that worshipped these deities. This paper assesses the impact of such imperial ceremonies on village life, especially how they blended with local operatic performances in new ritual forms. There is also data on performances of local songs and the indigenization of outside dramatic traditions, all of which contributed to the long-term development of village culture. Finally, the paper's conclusion discusses the function of rituals and opera performances as forms of cultural mediation that helped shape the interaction between the imperial state and local communities.