“Hieros Gamos, Greek for ”sacred marriage, ”sacred wedding feast”, or ”sacred sexual intercourse”, is the technical term of a mythical or ritual union between a god and a goddess, or more generally a divine and a human being, and most especially a king and a goddess. The term has its widest use in the study of kingship in the city cultures of the ancient Near East…
The hieros gamos as a royal ritual is the creation of early city-states built on the wealth provided by agriculture. Far from putting an end to the “primitive” village cults, they expanded and stylized them with forms that were derived from, and were variations of, earlier symbolism. One of these is the sexual union of the king and a priestess as an episode in the lengthy Babylonian Akitu (New Year) festival. The model for this rite is already given in Sumerian myths and temple customs.
The hieros gamos rite, attached to the New Year festival and celebrated in various cultic centers, symbolized the union of the king of the city and the city´s goddess, represented sometimes by the king´s consort, more often by a hierodoule, …a priestess. ..The entire wedding in the ritual is a replica…of the celestial union. Not only was the hierodoule the personification of a goddess, but also the king might be said to represent a god…
An early prototype of the ritual is the Sumerian story of the goddess Inanna and her relation to Dumuzi, the shepherd boy with whom the supreme, all – powerful goddess fell in love. In the drama the goddess descends into the netherworld for reasons that are not altogether clear but are certainly related to her ambition to perfect her rule by extending it even over the realm of the dead. She is defeated in her attempt, and her “elder sister”, Ereshkigal (“The Queen of the Great Below”) makes no exception in her case; she fixes “the look of death” on Inanna. Inanna cannot escape unless a substitute is found. She vows to find one. In her absence, Dumuzi, her love, spends his time with all the paraphernalia of wealth and power, occupying the throne. Although Inanna had no intention of consigning him to the netherworld in her place, she now fixes “the look of death” on him and orders the demons to take him away and torture him. The story ends in a compromise, whereby Dumuzi will be on earth for half the year, and the other half in the realm of death.
It is this type of mythological configuration that served as a model for the Sumero-Accadian kings, and it is this type of mythology with its many themes, sub-themes, and variations that formed the pattern of kingship and religion in the entire world of the ancient Near East. Ezekiel 8:14 is one of the texts in the tradition of Israel strongly opposed to most of the religious customs connected with the hieros gamos; it tells us of women who (ritually) bewailed the fate of Tammuz (Dumuzi) at the gates of the temple. A considerable number of details make it not at all unlikely that also the gospel story of Jesus Christ owes some of its features to the myth of the dying shepherd-god. Dumuzi (Tammuz) is not really represented as a god, and originally he was no god but rather a human king whose marriage to the great goddess (Inanna-Ishtar) was required to confer a sacred certainty, a future, and wealth on his land.
It is clear that kingship demanded a sacred foundation that could be provided only through the omnipotence of the great goddess.”
 Mircea Eliade (1987) Encyclopedia of Religion, volume 6 (”Hieros Gamos”)