Introduction: From Personal Deities to State Sacrificial Rites
The pantheon of Chinese folk beliefs is famously vast and complex, among which the City God, Mazu, and Emperor Guan are the three most representative: one is the guardian deity of city walls and moats, one is the goddess who protects seafarers, and one is the martial sage of loyalty and righteousness. The three have different origins, yet from the Song and Yuan dynasties onward they gradually took fixed form through state investiture and local sacrifice, constituting a clear thread of interaction between folk belief and state power. The City God can trace its distant origins to the water deity among the eight sacrifices in The Rites of Zhou; from the Tang and Song dynasties onward it evolved from a nature deity into a local official of the netherworld. Mazu began with the manifestation of a daughter of the Lin family on Meizhou Island during the Jianlong era of the Northern Song, and through the Song, Yuan, Ming, and Qing dynasties was repeatedly invested with titles up to that of Empress of Heaven. Emperor Guan, meanwhile, developed from Guan Yu, the famous general of Shu Han during the Three Kingdoms, and after being absorbed by Buddhism and Daoism in the Tang and Song and officially worshipped in the Ming and Qing, was elevated to Martial Sage, standing alongside the Literary Sage Confucius. This article intends to examine, from four levels—the origin of divine status, the evolution of functions, the system of investiture, and the geography of belief—the history of their titles and their sacrificial networks, and to discuss how Chinese folk belief, through the triple forces of literati writing, official canonization, and popular practice, formed a system of deities that possesses both a hierarchical order and local flexibility.
1. The Transformation of the City God's Divinity from Nature Worship to an Anthropomorphic Deity
The name "City God" first appears in The Book of Changes, in the Tai hexagram: "the city wall returns to the moat," originally referring to the moat protecting a city, and not yet possessing divine status. In the Eastern Han dynasty, Ban Gu's "Rhapsody on the Two Capitals" contains the phrase "guarding the boundaries of rivers and mountains, on which the city moat depends," still a general geographical designation. The worship of the City God as a deity is generally believed by scholars to have begun during the Northern and Southern Dynasties: the "Book of Northern Qi: Biography of Murong Yan" records that in the sixth year of Tianbao (555), when Murong Yan garrisoned Yingcheng, "there was previously a shrine in the city, popularly called the City God shrine," which is one of the earlier explicit records in the official histories. By the Tang dynasty, City God belief had become widespread in the Jiangnan region, and Li Yangbing, Han Yu, Du Mu, Zhang Yue, Zhang Jiuling, and others all wrote texts for sacrifices to the City God, among which Han Yu's "Sacrificial Text to the City God of Chaozhou" and Du Mu's "Sacrificial Text to the City God Praying for Rain" are pieces frequently cited in literary history. At this time the City God's divine character was still relatively vague, combining multiple functions such as protecting the city, praying for relief from floods and droughts, and judging in the underworld.
The City God's transition from an abstract guardian deity to an anthropomorphic one was roughly completed around the turn of the Tang and Song dynasties. There were two paths: first, historical figures were appointed as City Gods, such as Lord Chunshen Huang Xie worshipped in Suzhou, Wen Tianxiang in Hangzhou, Qin Yubo in Shanghai, and Pang Yu in Shaoxing; in the Ming dynasty's "Book on Water Conservancy in Wuzhong" and local gazetteers there are many such records. Second, Daoism incorporated him into its pantheon, calling the City God a deity who "cuts off evil and eliminates misfortune, protects the state and safeguards the realm," and assigning him the duty of managing the souls of the dead in the underworld. Zhao Yushi of the Song dynasty, in "Bintui Lu," volume eight, records that the City God's "shrines are almost everywhere under heaven," and explains that City Gods in various places were mostly filled by human ghosts, precisely reflecting this trend toward anthropomorphization.
The City God became a "local official of the underworld," forming a corresponding structure with the prefectural and county officials of the living world, and this pattern was fixed by the Ming dynasty. In the second year of Hongwu (1369), the Ming founder issued an edict enfeoffing the City Gods throughout the realm: the five places Kaifeng, Linhao, Taiping, Hezhou, and Chuzhou were made "Capital City Gods," rank 2a; the City Gods of each prefecture were made "Duke of Awful Numinosity," rank 2a; the City Gods of each department were made "Marquis of Numinous Protection," rank 3a; and the City Gods of each county were made "Earl of Manifest Protection," rank 4a. The following year the titles were abolished, and they were called only the City God spirit of such-and-such prefecture, department, or county, and each place was ordered to build a temple beside the prefectural, departmental, or county seat, alongside the government offices. In the third year of Hongwu (1370), an edict again fixed the City God temple system, abolishing sculpted images and setting up wooden tablets, and incorporating the sacrifices into the official spring and autumn offerings. This system gave City God belief unprecedented orthodox status, and the Ming and Qing dynasty rituals of the City God's procession, the City God's relief, and the City God's judgment of the underworld were all built upon it.
2. Mazu's Cumulative Enfeoffment from a Meizhou Shamaness to an Official Cult
The Mazu cult originated on Meizhou Island in Putian, Fujian, in the early Northern Song dynasty. Both Liao Pengfei's Record of the Reconstruction of the Shunji Temple at the Sacred Mound Ancestral Temple and Li Junfu's Comparative Matters of Puyang, from the Southern Song, state that the deity was the daughter of Lin Yuan, an inspector-general of the Min capital in the Five Dynasties period. She was born on the twenty-third day of the third month in the first year of the Jianlong reign of the Northern Song (960), "divinely wondrous from birth," able to foreknow people's fortunes and misfortunes, and after her death the local people built a temple to sacrifice to her. This account fixes Mazu's prototype as a local shamaness, and scholars generally hold that her divinity originally belonged to the category of popular "licentious cults," having nothing to do with the official sacrificial canon. The flourishing of maritime trade and fishing in Song-dynasty Putian provided the social soil for the Mazu cult; Meizhou, situated at the mouth of Xinghua Bay, was a key passage for seagoing vessels entering and leaving central Fujian, and the legends of Mazu's manifestations are mostly related to convoying ships, saving people, and calming waves, which precisely corresponds to this geographical condition.
Mazu's official recognition began in the fifth year of the Xuanhe reign of the Northern Song (1123), when Lu Yundi, a supervising secretary, was sent on a mission to Goryeo. On the return journey he encountered a storm and is said to have received the deity's manifest protection; upon returning to court he memorialized the throne, and the temple was granted the plaque "Shunji" (Favorable Aid). Thereafter imperial enfeoffments were recorded without interruption: in the twenty-sixth year of the Shaoxing reign of the Southern Song (1156) she was enfeoffed as "Lady Linghui," and during the Chunxi reign promoted to "Consort Linghui"; in the eighteenth year of the Zhiyuan reign of Kublai Khan, Emperor Shizu of the Yuan (1281), she was enfeoffed as "Heavenly Consort Protector of the State and Illustriously Manifest," and the title "Heavenly Consort" began from this time; in the seventh year of the Yongle reign of the Ming (1409) she was enfeoffed as "Heavenly Consort Who Protects the State and Shelters the People, Wondrously Numinous and Illustriously Responsive, of Vast Benevolence and Universal Salvation," and in the same year Zheng He set sail on his third voyage to the Western Seas, memorializing the throne to repair the Meizhou ancestral temple and personally going there to offer sacrifice, so that the Mazu cult spread to Southeast Asia along with Zheng He's fleet.
The Qing dynasty was the peak period of Mazu's titles. In the nineteenth year of the Kangxi reign (1680) she was enfeoffed as "Heavenly Consort Who Protects the State and Shelters the People, Wondrously Numinous and Illustriously Responsive, of Vast Benevolence and Universal Salvation"; in the twenty-third year of the Kangxi reign (1684), after Shi Lang pacified Taiwan, he memorialized the throne, and she was promoted and enfeoffed as "Empress of Heaven Who Protects the State and Shelters the People, Wondrously Numinous and Illustriously Responsive, of Benevolence and Mercy," so that Mazu went from consort to consort and from consort to empress, becoming "Empress of Heaven." Thereafter, in the second year of the Qianlong reign (1737) the title "Blessing All Beings" was added; in the twenty-second year of the Qianlong reign (1757) "Sincerely Moving and Universally Trusted" was added; in the sixth year of the Daoguang reign (1826) "Calming the Waves and Benefiting Transport" was added; in the seventh year of the Xianfeng reign (1857) "Quieting the Billows and Spreading Kindness" was added; in the eleventh year of the Tongzhi reign (1872) "Auspicious Protection" was added; and during the Guangxu reign further words such as "Safeguarding and Widely Relieving" were added. According to statistics, imperial enfeoffments over the ages totaled several dozen, with accumulated title characters exceeding sixty, making her one of the goddesses with the longest titles in Chinese popular religion. The geographical expansion of the Mazu cult was closely related to Fujianese migration, maritime merchant networks, and the grain-transport system: the Tianhou Palace in Tianjin was built in the third year of the Taiding reign of the Yuan (1326); most Mazu temples in Taiwan were established by Fujianese and Guangdong migrants who carried incense ashes to divide the spiritual power; and the boatmen of the Ming and Qing grain transport also honored Mazu as their patron deity, forming a devotional geography in which "wherever there is seawater, there is Mazu."
3. From Shu Han General to Martial Sage: The Deification of Lord Guan
Guan Yu (c. 160–220) was a native of Xieliang in Hedong during the late Eastern Han dynasty. He rose to the office of General of the Vanguard and Marquis of Han Shou Pavilion. In the twenty-fourth year of the Jian'an era (219), after his defeat at Maicheng, he was killed by Sun Quan. His status during his lifetime was hardly eminent; his biography in the Records of the Three Kingdoms runs to only a thousand-odd characters. Scholars generally trace the starting point of Guan Yu's deification to the Sui and Tang dynasties: the Tiantai school of Buddhism propagated the claim that he received the precepts from Master Zhiyi and became a protector of the Dharma, giving rise to the notion of the "Sangharama deity"; Daoism, for its part, held that he received office from the god of Yuquan Mountain and commanded the "subjugation of demons throughout the Three Realms." Dong Ting's Record of the Restoration of the Guan Temple at Yuquan by Duke Pei, Governor of Jiangling and Military Commissioner of Jingnan, dated to the eighteenth year of the Zhenyuan era of Emperor Dezong of Tang (802), is one of the earlier documents concerning a Guan temple, showing that by the Tang dynasty a dedicated cult already existed in the Jingzhou region.
Guan Yu's entry into the state sacrificial canon began in the Song dynasty. In the first year of the Chongning era of Emperor Huizong of Song (1102), he was enfeoffed as Duke of Loyalty and Beneficence; in the fifth year of the Xuanhe era (1123), as Prince of Righteousness and Courage, Martial and Pacifying—rising from marquis to duke, and from duke to prince. In the first year of the Tianli era of Emperor Wenzong of Yuan (1328), he was further enfeoffed as Prince Xianling Yiyong Wu'an Yingji. In the eighteenth year of the Wanli era of the Ming (1590), he was enfeoffed as Emperor of Loyalty and Righteousness, Protector of the State and Assistant of Heaven; and in the forty-second year of Wanli (1614), he was again enfeoffed as the Great Emperor Who Subdues Demons Throughout the Three Realms, Divinely Mighty and Far-Reaching, Heavenly Worthy, Lord Guan the Holy Emperor—and it was from this that the title "Lord Guan" was established. In the ninth year of the Shunzhi era of the Qing (1652), he was granted by imperial edict the title of Great Emperor Guan the Sage, Loyal, Righteous, Divine, and Martial; in the twenty-third year of the Qianlong era (1758), he was further enfeoffed as Great Emperor Guan the Sage, Loyal, Righteous, Divine, Martial, Numinous, and Protective; in the eighteenth year of the Jiaqing era (1813), "Benevolent and Brave" was added; in the eighth year of the Daoguang era (1828), "Majestic and Manifest" was added; and during the Xianfeng era, further epithets such as "Protector of the State," "Guardian of the People," "Utterly Sincere," "Pacifying," "Aiding and Assisting," and "Proclaiming Virtue" were added, until by the fifth year of the Guangxu era (1879) his accumulated title ran to more than twenty characters. Guan Yu thus came to be honored as the "Martial Sage," standing alongside Confucius, the "Civil Sage," with sacrifices at the Martial Temple extending throughout the capital and the provinces and prefectures.
The elevation of Guan Yu's divine status is inseparable from the dissemination of Romance of the Three Kingdoms. In the Popular Romance of the Three Kingdoms by Luo Guanzhong at the turn of the Yuan and Ming dynasties, Guan Yu was fashioned into the paragon of "righteousness reaching the heavens." His image spread widely through opera, storytelling, and pictorial representation, transforming him from a historical figure into a moral symbol. During the Ming and Qing periods, Guan Yu spanned all three teachings—Confucianism, Buddhism, and Daoism: Confucians honored him as the "Martial Sage," Buddhist temples enshrined him as the "Sangharama Bodhisattva," Daoist temples worshipped him as "Lord Guan the Holy Emperor," and merchants revered him as the "Martial God of Wealth," forming a unique configuration in which "the three teachings jointly venerate him and all trades jointly sacrifice to him." Shanxi merchants in particular worshipped Lord Guan, regarding him as the patron deity of their trade for his integrity and fidelity to promises; guild halls of Shanxi and Shaanxi merchants across the country mostly established temples to Lord Guan. According to incomplete statistics, within the city of Beijing during the Qing dynasty there were more than a hundred temples to Lord Guan, the largest number of any temple type in the capital.
4. The Investiture System and the Boundary Work Between Orthodox and Illicit Cults
The status of deities in Chinese popular religion depended to a large extent on whether they entered the state sacrificial register. From the Tang and Song dynasties onward, the imperial court incorporated local deities into the established order through two methods—granting plaques and granting titles—which constituted what was known as "orthodox cults" (zhengsi). The Song-era institutional compendium Song Huiyao Jigao, in the "Mountains, Rivers, Shrines, and Temples" section of the ritual chapter, records a large number of cases of granted plaques and titles, revealing how comprehensive the system was: a grant of a plaque was petitioned by the transport commissioner or by prefectural and county authorities, reviewed by the Ministry of Rites and the Court of Imperial Sacrifices, and issued after approval by the Secretariat-Chancellery or the emperor; a grant of a title then layered laudatory epithets on top of the plaque grant, with the number of characters accumulating from two to several dozen. The court's criteria for investiture were not simply "efficacy" but rather whether the deity had "rendered merit to the people" and "warded off disasters and defended against calamities"—that is, whether it possessed a social function of protecting the state and succoring the populace.
Opposed to orthodox cults were "illicit cults" (yinsi), referring to shrines not officially recognized and not listed in the sacrificial register. The Book of Rites, in the "Qu Li" chapter, states: "To sacrifice to what one ought not to sacrifice is called illicit sacrifice"; the Han Shu, in its "Treatise on Suburban Sacrifices," likewise records that "each had its own ritual norms, and illicit sacrifices were prohibited." From the Tang and Song onward, successive governments repeatedly destroyed illicit shrines: in the Tang, Di Renjie, on a tour of inspection in Jiangnan, destroyed over 1,700 illicit shrines; in the Song, Xia Song, as prefect of Hongzhou, destroyed more than a thousand illicit shrines; and in the third year of the Hongwu reign of the Ming founder (1370), an edict abolished the titles of deities throughout the realm and prohibited illicit sacrifices. Yet the boundary between "orthodox" and "illicit" was not fixed. The City God, Mazu, and Emperor Guan all gradually obtained imperial investiture from local deity status, precisely demonstrating that a dynamic mechanism of transformation existed between orthodox and illicit cults. The scholarly consensus is that the core of this mechanism was a three-way negotiation among literati, officials, and the populace: the people promoted the spread of a cult on the basis of efficacy, the literati screened it according to the standard of "rendering merit to the people," and the officials absorbed it through the instrument of investiture.
It is worth noting that deities, once invested, were often assigned more clearly defined official functions. The City God was transformed from a guardian of city walls into a local magistrate of the netherworld, assisting living officials in governing the realm of the dead; his temples were mostly situated beside prefectural, departmental, and county government offices, forming a spatial correspondence with official compounds as the "two yamen of yin and yang." Mazu was transformed from a local female shaman into the "State-Protecting and People-Succoring" Celestial Consort and Empress of Heaven, her functions incorporated into state affairs such as grain transport, coastal defense, and the missions of imperial envoys. Emperor Guan was transformed from a local military figure into the "Loyal, Righteous, Divine, and Martial" Martial Sage, his temples enrolled in the state system of martial temple sacrifices and standing alongside the Confucian civil temples. The accumulation of titles was not a simple piling up of honors but the result of continuous adjustment between the functions of deities and the needs of the state.
5. The Geographical Distribution of the Three Deities' Cults and Their Sacrificial Networks
From the perspective of the geography of belief, the distributions of the City God, Mazu, and Lord Guan each have their own characteristics. The City God cult was centered on administrative cities; almost every prefecture, subprefecture, and county seat had a City God temple, forming an "underworld administrative network" isomorphic with the bureaucratic system. In the Ming dynasty it was stipulated that City God temples be built beside prefectural, subprefectural, and county seats of government, with their sacrificial ranks corresponding to administrative ranks: the capital City God, prefectural City God, subprefectural City God, and county City God each had their own order of precedence. In Qing dynasty local gazetteers, the City God temple was virtually a mandatory entry in the "shrines and temples" section of every prefectural, subprefectural, and county gazetteer; for example, the Suzhou Prefecture Gazetteer, the Hangzhou Prefecture Gazetteer, and the Shanghai County Gazetteer all record in detail the location, history, and sacrificial rites of the City God temple. This "administrative isomorphism" of the City God cult made it one of the most important public sacrificial spaces in traditional Chinese cities.
The Mazu cult, by contrast, took the coastline, the banks of rivers, and the migration routes of Fujianese people as its axes of distribution. Fujian, Guangdong, Taiwan, Hainan, and overseas Chinese communities in Southeast Asia were the core areas of the Mazu cult. The Taiwan region has a great number of Mazu temples; according to surveys from the Japanese occupation period and subsequent statistics, there are more than five hundred temples whose principal deity is Mazu, among which Dajia Zhenlan Temple, Beigang Chaotian Temple, Xingang Fengtian Temple, and Lugang Tianhou Temple are especially famous. Each year around Mazu's birthday in the third lunar month, the Dajia Mazu pilgrimage procession is one of the most important folk religious activities in Taiwan, covering roughly more than three hundred kilometers over nine days and eight nights and crossing the four counties and cities of Taichung, Changhua, Yunlin, and Chiayi. The Tianhou Temple in Tianjin, the Tianhou Xinggong in Yantai, Shandong, and the Tianhou Temple in Dalian, Liaoning, reflect the northward spread of the Mazu cult along with grain transport and maritime shipping.
The cult of Lord Guan had the broadest geographical distribution, extending to virtually all urban and rural areas throughout the country and, with overseas Chinese, spreading to Southeast Asia, Japan, Korea, and Chinese communities in Europe and America. The distribution of Lord Guan temples was closely tied to commercial networks: Shanxi merchants' guild halls and Shaanxi-Shanxi guild halls often established Lord Guan temples as places for fellow natives to deliberate, offer sacrifices, and provide mutual aid; in Qing dynasty Beijing there were more than a hundred Lord Guan temples, with the one at Zhengyangmen enjoying especially flourishing incense offerings. The regional expansion of the Lord Guan cult was interwoven with three forces—the dissemination of Romance of the Three Kingdoms, the popularity of opera, and the migration of merchant groups—forming a pattern in which "temples follow the people." Although the sacrificial networks of the three deities' cults each had their own emphasis—the City God relying on administrative cities, Mazu on maritime migration, and Lord Guan on commercial networks—together they constituted a multi-layered system of Chinese folk belief extending from the local to the national, from the popular to the official, and from the indigenous to the overseas.
6. The Cultural Logic Behind Divine Status, Functions, and Titles
Taking together the evolution of titles and functions of the City God, Mazu, and Lord Guan, several deep-seated characteristics of Chinese folk belief come into view. First, the humanization of divine status. All three were deified from historical or local figures: the City God was typically filled by a historical personage, Mazu was originally a daughter of the Lin family of Meizhou, and Guan Yu was a famous general of Shu Han—their divine status in every case rests on a foundation of human character. This characteristic is mutually reinforced by the Confucian sacrificial tradition that "ancestors are honored for merit and lineage heads for virtue," the Daoist notion that "merit and virtue lead to godhood," and the Buddhist doctrine of karmic retribution, together shaping the "this-worldliness" of Chinese deities.
Second, the officialization and professionalization of functions. The City God oversaw local administration in the netherworld, Mazu oversaw maritime escort and protection, and Lord Guan oversaw the teaching of loyalty and righteousness and the protection of commerce. The division of functions among the three was clear, and all corresponded to the needs of the state. The system of imperial investiture was precisely the mechanism that transformed folk efficacy into official function: local deities received bestowed plaques for their efficacy, bestowed titles for protecting the state and succoring the people, and accumulated titles as their functions expanded. This process was neither a one-way imposition by the state nor a spontaneous and independent development of the populace, but rather the result of interaction among the literati, the officialdom, and the common people.
Third, the hierarchization and accumulation of titles. The City God had ranks corresponding to capital, prefecture, department, and county; Mazu had the grades of Lady, Consort, Heavenly Consort, and Heavenly Empress; Lord Guan had the sequence of Marquis, Duke, King, and Emperor. The grades of titles corresponded to administrative ranks and levels of divine status. The accumulation of titles was characterized by the piling up of laudatory terms, producing the phenomenon of ultra-long titles—Mazu's titles exceeding sixty characters and Lord Guan's numbering more than twenty. Such accumulation was both an accretion of honor and a mark of expanding functions, reflecting the adaptability of Chinese folk belief in which "deities change with the times."
Fourth, the dynamic boundary between orthodox and licentious sacrifices. None of the three was originally a state orthodox sacrifice: the City God was merely a local shrine in the Northern and Southern Dynasties, Mazu belonged to local shamanic sacrifice in the Northern Song, and Guan Yu had a dedicated sacrifice only in the Jingzhou area during the Tang. Through imperial investiture, all three successively entered the state sacrificial canon and became orthodox deities. This process shows that the "orthodox" and the "heterodox" in Chinese folk belief were not fixed labels, but rather the result of continuous negotiation and dynamic adjustment through literati writing, official recognition, and popular practice. It is precisely this elasticity that enabled Chinese folk belief to maintain a structural connection with state order while preserving local diversity.
Conclusion
The City God, Mazu, and Lord Guan represent three distinct types of deity in Chinese folk belief: the City God, a fusion of nature deity and historical figure, became a local official of the underworld; Mazu, a local shamaness repeatedly ennobled as Empress of Heaven, became the protector of seafarers; and Lord Guan, a historical military general elevated to Martial Sage, became a moral and commercial symbol spanning the Three Teachings. The evolution of their titles reflects the long historical trajectory of interaction between the state canonization system and local religious practice since the Song and Yuan dynasties. Canonization was not merely the granting of honor; it was the definition of function, the arrangement of rank, and the absorption of order.
Viewed over a longer span, the cults of the City God, Mazu, and Lord Guan remain active today in mainland China, Taiwan, Hong Kong, Macao, and overseas Chinese communities, where their temples, festivals, pilgrimages, and processions constitute important cultural bonds of Chinese society. Studying the functions and titles of these three deities not only helps illuminate the inner logic of Chinese folk belief but also provides a concrete and nuanced point of entry for observing the dynamic relationships between state and locality, orthodoxy and heterodoxy, official and popular. In the contemporary context of intangible cultural heritage protection and local cultural development, the historical experience of this devotional lineage still holds reference value.
