Hieros gamos, Greek for sacred marriage, names the ritual or mythic union of a god and goddess, or of a deity and a human representative, understood to secure fertility and the wellbeing of land and people. The term is used comparatively for a set of practices and narratives attested most clearly in Mesopotamia.
The Sumerian material is the core evidence. A body of poetry describes the union of Inanna and Dumuzi in explicit and celebratory terms, and it appears that in the Ur III and Isin periods a rite was performed in which the king took the role of Dumuzi opposite a priestess representing Inanna, with the king's legitimacy and the land's fertility understood to depend on it. The details are disputed, and above all the question of whether the rite involved actual intercourse or was enacted symbolically; the texts are poetry, their relation to performed ritual is not always clear, and scholars have become considerably more cautious than the confident reconstructions of the mid-twentieth century.
Related material appears elsewhere. Greek tradition has the marriage of Zeus and Hera, re-enacted ritually at several sites, and the annual union of the wife of the archon basileus with Dionysus at Athens. Egyptian material has the divine birth of the pharaoh from a union of the god with the queen, depicted in sequences of temple reliefs. Indian tradition makes the divine couple a central image, and Tantric traditions in both Hindu and Buddhist forms use sexual union as symbol and, in some lineages, as practice, though the extent of literal as against visualised practice is variously reported and belongs to initiatory material rather than to public teaching.
The category has been badly over-extended, and this is the main caution. Nineteenth- and early twentieth-century scholarship working within Frazer's framework found sacred marriage and fertility ritual almost everywhere and read a great deal of ancient religion as agricultural magic; most of that has been withdrawn. Claims of widespread "sacred prostitution" across the ancient Near East, in particular, rested largely on Herodotus and on assumption rather than on local documentary evidence, and have been substantially rejected in recent scholarship. The use of the term in modern popular writing to designate a supposed suppressed tradition of sacred sexuality within Christianity has no scholarly support whatever.
What remains solid is the Mesopotamian evidence for a royal rite involving Inanna and Dumuzi; the general and well-attested use of marital imagery for the relation between a deity and a people; and the long persistence of that imagery in Jewish readings of the Song of Songs, in Christian bridal mysticism, and in Sufi and bhakti poetry.