Yam (sometimes Yamm; ; 'sea') was a god representing the sea and other sources of water worshiped in various locations on the eastern Mediterranean coast, as well as further inland in modern Syria. He is best known from the Ugaritic texts. While he was a minor deity in Ugaritic religion, he is nonetheless attested as a recipient of offerings, and a number of theophoric names invoking him have been identified. He also played a role in Ugaritic mythology. In the Baal Cycle he is portrayed as an enemy of the weather god, Baal. Their struggle revolves around attaining the rank of the king of the gods. The narrative portrays Yam as the candidate favored by the senior god El, though ultimately it is Baal who emerges victorious. Yam nonetheless continues to be referenced through the story after his defeat. In texts from other archaeological sites in Syria, attestations of Yam are largely limited to theophoric names. In Emar he was among the many deities venerated during a local festival, zukru, which took place once every seven years.

Yam was also known in Ancient Egypt, though there is no evidence that he was actively worshiped in ancient Egyptian religion. He plays a role in a myth preserved in the so-called Astarte Papyrus, which is presumed to be an adaptation of western motifs, though not necessarily of the Baal Cycle. Yam is portrayed as an enemy of the Ennead who demands a tribute from the other gods, while the eponymous goddess is tasked with bringing it to him. Set, who serves as a stand-in for Baal, is responsible for defeating him, though the outcome of their battle is only known from references in incantations, as the ending of the Astarte Papyrus is not preserved. Yam is also present in the Tale of Two Brothers.

In the Hebrew Bible, Yam appears as an enemy of Yahweh. It is presumed that his presence reflects a reference of a shared West Semitic tradition on early Israelite literature. A further possible reference to Yam has been identified in the Phoenician History of Philo of Byblos, a Hellenistic euhemeristic work combining Phoenician and Greco-Roman elements. One of the figures mentioned in this work, Pontos, is presumed to constitute a translation of Yam.

In comparative scholarship, Yam's role in the Baal Cycle is often analyzed alongside other myths from the region focused on battles between figures representing the weather and the sea. Historically the conflict with Tiamat in Enūma Eliš was seen as a close parallel, though in more recent scholarship differences between these two narratives and the respective roles of these figures have also been pointed out. Comparisons have also been made between Yam and Kiaše and Ḫedammu from Hurrian mythology.

Name and character The theonym written as () in the Ugaritic alphabetic script is vocalized in modern literature as Yam, Yamm or Yammu. It is identical with the ordinary Ugaritic noun meaning 'sea'. Its use as a theonym in Ugaritic religion reflects the deification of the corresponding geographical feature. Yam accordingly functioned as the deification of the sea. He was also associated with other bodies of water. It has been argued that in Ugaritic myths he is fully anthropomorphic. However, no known sources describe his iconography. Yam's secondary name was Nahar, "River". His most common epithet, and the third most common epithet in the Ugaritic text corpus overall, is ṯpṭ nhr, "judge River" or "ruler River", ṯpṭ being a cognate of Hebrew shophet. It has been suggested that Nahar might have originally been a separate deity who eventually came to be conflated with Yam. Aicha Rahmouni argues that the full epithet should be understood as a reference to river ordeal, in which she assumes he played a role comparable to the Mesopotamian god Idlurugu. However, Herbert Niehr concludes that this title only reflected Yam's mastery over freshwater, as river ordeal is not attested in sources from Ugarit. Yam was also addressed as a "prince" (zbl), though in ten out of eleven cases this title occurs only in parallel with ṯpṭ nhr.

A cognate of Yam's Ugaritic name has been identified in the Akkadian dialect used in Emar. It was written in cuneiform as dYa-a-mi. Cognate words referring to the sea occur in Phoenician, Aramaic, Hebrew and Arabic. Furthermore, the early form wa-mu or wa-mu-um (/wammu(m)/) has also been identified in Eblaite. It preserves an "archaic *w-prototype of this lexeme" predating the shift from w to y attested in Northwest Semitic languages. As a loanword, the word yammu is also attested in Egyptian under a variety of spellings, typically as a designation for the Mediterranean Sea, though it could function as a theonym too.

In texts from Ugarit written in syllabic cuneiform, the sign sequence A.AB.BA, elsewhere read as the Akkadian word tâmtu, could be employed to write the ordinary word yammu as well as Yam's name, as attested in a lexical text mentioning dA.AB.BA and by the logographic writing of the theophoric name 'bdym, ÌR.A.AB.BA. However, dA.AB.BA does not appear as an entry in any Mesopotamian god lists. A figure whose name is written this way appears in the Myth of the Plough, a text only known from a single late copy from either the Neo-Babylonian or Achaemenid period, but she is female and has been characterized as dissimilar to Yam by Aaron Tugendhaft.

In addition to functioning as a distinct theonym, the Ugaritic word ym is also attested as a part of one of the epithets of Athirat, rbt 'aṯrt ym, "Lady Athirat of the Sea". However, it is agreed that in this case the ordinary word is meant, rather than an allusion to an unknown myth involving Yam and this goddess. Athirat's association with the sea understood as a body of water rather than a deity is well attested, but its nature is poorly understood. However, Steve A. Wiggins suggests that due to Yam's primary role as a sea god, "his domain is probably not encroached upon by that of Athirat". Two literary passages which might refer to deities as bn ym, "son of the sea", are also assumed to refer to the body of water rather than Yam.

Ugaritic texts Yam is best known from the Ugaritic texts, though he was a low ranking deity in the Ugaritic pantheon. In the standard list of deities, he occupies the thirtieth position, after the assembly of the gods treated collectively (Puḫru 'Ilīma) and before 'Uṯḫatu, the deified censer. In the corresponding list of offerings, he is the recipient of a ram, similarly as most of the other deities. He receives the same animal in a text labeled as the "Sacrificial liturgy for the Gods-of-the-Land". Another offering of a ram is mentioned in the text RS 1.009, which states that it took place on the third day of an unidentified month. RS 1.001, the first text discovered during the excavations at Ras Shamra, a description of a ritual taking place over the course of a single day and night, mentions the sacrifice of a cow to Yam at night, after a similar offering to Išḫara and before these aimed at Baal and Yarikh. In a similar list, RS 24.246, Yam and Baal occupy the same line together as the third entry, after Išḫara and before Yarikh. This placement might reflect their interactions in the Baal Cycle.

Thirteen individuals bearing theophoric names invoking Yam have been identified in the Ugaritic texts. Examples include Yammu'ilu ("Yam is god"), 'Iluyammu ("a god is Yam"), Milkuyammu ("a king is Yam") and 'Abduyammi ("servant of Yam").

Baal Cycle

In the Baal Cycle (KTU 1.1-1.6) Yam is portrayed as one of the enemies of the eponymous god, Baal. He is his main rival in the struggle for the status of king of the gods. The conflict between Yam and Baal is considered one of the three major episodes of the Baal Cycle, with the other two being the construction of Baal's palace and his conflict with Mot. It forms approximately one third of the full composition. Theodore J. Lewis has summarized the confrontation between them as "the second most riveting scene in the Baʿlu Cycle (bettered only by Baʿlu's battle with Motu)".

The motif of the combat between the weather god and the sea first occurs in a letter sent by a certain Nūr-Sîn, a representative of Mari in Aleppo, to king Zimri-Lim. A passage in it has the form of a message from Adad:

It has been argued that an incantation from Ebla in which the weather god, Hadda, vanquishes snakes with the help of Ammarik, might be an even earlier example, but according to Daniel Schwemer no conclusive evidence in favor of this interpretation is available. In the early tradition the enemy of the weather god was known as Têmtum, a "sea numen" (Meernumen). The name of this figure was written without the so-called divine determinative (dingir) in cuneiform. Seals showing a weather god striking a serpent have been tentatively identified as a representation of the battle between Adad and Têmtum. has proposed that the motif of battle against the sea reached inland Syria from Ugarit, but this interpretation is regarded as unlikely. Most likely a variant of the account known from the Mari was integrated into Ugaritic tradition, and as a result eventually into the Baal Cycle.

In the beginning of the Ugaritic narrative, Yam is presented as El's favored candidate for the position of the king of the gods, and he seemingly enjoys the support of much of the divine council. He is described as "the beloved of El" (mdd 'il), which reflects the special status assigned to him by the head of the pantheon. He also receives the name Yam from him in place of his original name (). The interpretation of the latter remains a matter of scholarly dispute, though it has been tentatively related to Ieuo known from Philo of Byblos' Phoenician History, a deity apparently worshiped in Beirut in antiquity. Smith argues that "Ieuo is more likely to be a deity indigenous to Phoenicia than to Israel, and the identification to Ieuo with Yamm/yw, though by no means assured, is preferable to an equation with Yahweh" It is possible that Athirat is responsible for proclaiming the bestowal of the additional name upon Yam. El also addresses Yam as his son, which might reflect either actual parentage or adoption related to his royal status. Furthermore, he orders Kothar-wa-Khasis to build a palace for the sea god. Its construction is meant to signify his legitimacy. Baal's position in the narrative is comparatively weaker, but he is presented as the better candidate for the position of the king of the gods by the narrator.