The most interesting and original aspect of Cambojan religion is its connection with the state and the worship of deities somehow identified with the king or with prominent personages[280]. These features are also found in Champa and Java. In all these countries it was usual that when a king founded a temple, the god worshipped in it should be called by his name or by something like it. Thus when Bhadravarman dedicated a temple to Śiva, the god was styled Bhadreśvara. More than this, when a king or any distinguished person died, he was commemorated by a statue which reproduced his features but represented him with the attributes of his favourite god. Thus Indravarman and Yaśovarman dedicated at Bakô and Lolei shrines in which deceased members of the royal family were commemorated in the form of images of Śiva and Devî bearing names similar to their own. Another form of apotheosis was to describe a king by a posthumous title, indicating that he had gone to the heaven of his divine patron such as Paramavishṇuloka or Buddhaloka. The temple of Bayon was a truly national fane, almost a Westminster abbey, in whose many shrines all the gods and great men of the country were commemorated. The French archæologists recognize four classes of these shrines dedicated respectively to (a) Indian deities, mostly special forms of Śiva, Devî and Vishṇu; (b) Mahayanist Buddhas, especially Buddhas of healing, who were regarded as the patron saints of various towns and mountains; (c) similar local deities apparently of Cambojan origin and perhaps corresponding to the God of the City worshipped in every Chinese town; (d) deified kings and notables, who appear to have been represented in two forms, the human and divine, bearing slightly different names. Thus one inscription speaks of Śrî Mahendreśvarî who is the divine form (vraḥ rûpa) of the lady Śrî Mahendralakshmî.

The presiding deity of the Bayon was Śiva, adored under the form of the linga. The principal external ornaments of the building are forty towers each surmounted by four heads. These were formerly thought to represent Brahmâ but there is little doubt that they are meant for lingas bearing four faces of Śiva, since each head has three eyes. Such lingas are occasionally seen in India[281] and many metal cases bearing faces and made to be fitted on lingas have been discovered in Champâ. These four-headed columns are found on the gates of Angkor Thom as well as in the Bayon and are singularly impressive. The emblem adored in the central shrine of the Bayon was probably a linga but its title was Kamrateṇ jagat ta râja or Devarâja, the king-god. More explicitly still it is styled Kamrateṇ jagat ta râjya, the god who is the kingdom. It typified and contained the royal essence present in the living king of Camboja and in all her kings. Several inscriptions make it clear that not only dead but living people could be represented by statue-portraits which identified them with a deity, and in one very remarkable record a general offers to the king the booty he has captured, asking him to present it "to your subtle ego who is Iśvara dwelling in a golden linga[282]." Thus this subtle ego dwells in a linga, is identical with Śiva, and manifests itself in the successive kings of the royal house.

The practices described have some analogies in India. The custom of describing the god of a temple by the name of the founder was known there[283]. The veneration of ancestors is universal; there are some mausolea (for instance at Ahar near Udeypore) and the notion that in life the soul can reside elsewhere than in the body is an occasional popular superstition. Still these ideas and practices are not conspicuous features of Hinduism and the Cambojans had probably come within the sphere of another influence. In all eastern Asia the veneration of the dead is the fundamental and ubiquitous form of religion and in China we find fully developed such ideas as that the great should be buried in monumental tombs, that a spirit can be made to reside in a tablet or image, and that the human soul is compound so that portions of it can be in different places. These beliefs combined with the Indian doctrine that the deity is manifested in incarnations, in the human soul and in images afford a good theoretical basis for the worship of the Devarâja. It was also agreeable to far-eastern ideas that religion and the state should be closely associated and the Cambojan kings would be glad to imitate the glories of the Son of Heaven. But probably a simpler cause tended to unite church and state in all these Hindu colonies. In mediæval India the Brahmans became so powerful that they could claim to represent religion and civilization apart from the state. But in Camboja and Champa Brahmanic religion and civilization were bound up with the state. Both were attacked by and ultimately succumbed to the same enemies.

The Brahmanism of Camboja, as we know it from the inscriptions, was so largely concerned with the worship of this "Royal God" that it might almost be considered a department of the court. It seems to have been thought essential to the dignity of a Sovereign who aspired to be more than a local prince, that his Chaplain or preceptor should have a pontifical position. A curious parallel to this is shown by those mediæval princes of eastern Europe who claimed for their chief bishops the title of patriarch as a complement to their own imperial pretensions. In its ultimate form the Cambojan hierarchy was the work of Jayavarman II, who, it will be remembered, reestablished the kingdom after an obscure but apparently disastrous interregnum. He made the priesthood of the Royal God hereditary in the family of Śivakaivalya and the sacerdotal dynasty thus founded enjoyed during some centuries a power inferior only to that of the kings.

In the inscriptions of Sdok Kâk Thom[284] the history of this family is traced from the reign of Jayavarman II to 1052. The beginning of the story as related in both the Sanskrit and Khmer texts is interesting but obscure. It is to the effect that Jayavarman, anxious to assure his position as an Emperor (Cakravartin) independent of Javâ[285], summoned from Janapada a Brahman called Hiranyadâma, learned in magic (siddhividyâ), who arranged the rules (viddhi) for the worship of the Royal God and taught the king's Chaplain, Śivakaivalya, four treatises called Vrah Vinâśikha, Nayottara, Sammoha and Śiraścheda. These works are not otherwise known[286]. The king made a solemn compact that "only the members of his (Śivakaivalya's) maternal[287] family, men and women, should be Yâjakas (sacrificers or officiants) to the exclusion of all others." The restriction refers no doubt only to the cult of the Royal God and the office of court chaplain, called Purohita, Guru or Hotri, of whom there were at least two.

The outline of this narrative, that a learned Brahman was imported and charged with the instruction of the royal chaplain, is simple and probable but the details are perplexing. The Sanskrit treatises mentioned are unknown and the names singular. Janapada as the name of a definite locality is also strange[288], but it is conceivable that the word may have been used in Khmer as a designation of India or a part of it.

The inscription goes on to relate the gratifying history of the priestly family, the grants of land made to them, the honours they received. We gather that it was usual for an estate to be given to a priest with the right to claim forced labour from the population. He then proceeded to erect a town or village embellished with temples and tanks. The hold of Brahmanism on the country probably depended more on such priestly towns than on the convictions of the people. The inscriptions often speak of religious establishments being restored and sometimes say that they had become deserted and overgrown. We may conclude that if the Brahman lords of a village ceased for any reason to give it their attention, the labour and contributions requisite for the upkeep of the temples were not forthcoming and the jungle was allowed to grow over the buildings.

Numerous inscriptions testify to the grandeur of the Śivakaivalya family. The monotonous lists of their properties and slaves, of the statues erected in their honour and the number of parasols borne before them show that their position was almost regal, even when the king was a Buddhist. They prudently refrained from attempting to occupy the throne, but probably no king could succeed unless consecrated by them. Sadaśiva, Śaṇkarapaṇḍita and Divâkarapaṇḍita formed an ecclesiastical dynasty from about 1000 to 1100 A.D. parallel to the long reigns of the kings in the same period[289]. The last-named mentions in an inscription that he had consecrated three kings and Śaṇkarapaṇḍita, a man of great learning, was de facto sovereign during the minority of his pupil Udayâdityavarman nor did he lose his influence when the young king attained his majority.

The shrine of the Royal God was first near Mt. Mahendra and was then moved to Hariharâlaya[290]. Its location was definitely fixed in the reign of Indravarman, about 877 A.D. Two Śivakaivalya Brahmans, Śivasoma and his pupil Vâmaśiva, chaplain of the king, built a temple called the Śivâśrama and erected a linga therein. It is agreed that this building is the Bayon, which formed the centre of the later city of Angkor. Indravarman also illustrated another characteristic of the court religion by placing in the temple now called Prah Kou three statues of Śiva with the features of his father, grandfather and Jayavarman II together with corresponding statues of Śakti in the likeness of their wives. The next king, Yaśovarman, who founded the town of Angkor round the Bayon, built near his palace another linga temple, now known as Ba-puon. He also erected two convents, one Brahmanic and one Buddhist. An inscription[291] gives several interesting particulars respecting the former. It fixes the provisions to be supplied to priests and students and the honours to be rendered to distinguished visitors. The right of sanctuary is accorded and the sick and helpless are to receive food and medicine. Also funeral rites are to be celebrated within its precincts for the repose of the friendless and those who have died in war. The royal residence was moved from Angkor in 928, but about twenty years later the court returned thither and the inscriptions record that the Royal God accompanied it.

The cultus was probably similar to what may be seen in the Sivaite temples of India to-day. The principal lingam was placed in a shrine approached through other chambers and accessible only to privileged persons. Libations were poured over the emblem and sacred books were recited. An interesting inscription[292] of about 600 A.D. relates how Śrîsomasarman (probably a Brahman) presented to a temple "the Râmâyaṇa, the Purâṇa and complete Bhârata" and made arrangements for their recitation. Sanskrit literature was held in esteem. We are told that Sûryavarman I was versed in the Atharva-Veda and also in the Bhâshya, Kâvyas, the six Darśanas, and the Dharmaśâstras[293]. Sacrifices are also frequently mentioned and one inscription records the performance of a Koṭihoma[294]. The old Vedic ritual remained to some extent in practice, for no circumstances are more favourable to its survival than a wealthy court dominated by a powerful hierarchy. Such ceremonies were probably performed in the ample enclosures surrounding the temples[295].