Yam (sometimes Yamm; Ugaritic: 𐎊𐎎, romanized: Yammu; “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.