Leviathan is a sea-monster of the Hebrew Bible whose language is older than the Bible itself. Ugaritic texts from Ras Shamra, of the fourteenth or thirteenth century BCE, describe the storm-god Baal defeating Litan (Lotan), "the fleeing serpent, the twisting serpent," in almost exactly the words Isaiah 27:1 uses of Leviathan. This places the biblical creature within the wider Near Eastern Chaoskampf, the combat of a storm-god against the monster of the primeval sea, seen also in the Babylonian Tiamat. In the Hebrew scriptures the motif is subordinated to one God: Leviathan is not a rival deity but a creature, sometimes the object of divine victory (Psalm 74), sometimes simply one of God's made things at play (Psalm 104), and in Job 41 a beast whose sheer unmasterable power is paraded before Job to silence him.
The plural in Psalm 74:14, "you crushed the heads of Leviathan," has been read by some scholars as a survival of the older multi-headed serpent imagery attested for Ugaritic Litan, in contrast to the singular sea-beast of Job 41, suggesting that biblical Hebrew inherited more than one version of the monster from its Near Eastern background and did not always flatten them into a single consistent creature. Isaiah 27:1 goes further, naming "the twisting serpent" and "the dragon that is in the sea" as two objects of a single divine victory, language later rabbinic exegesis took as evidence for two Leviathans, one of each sex, rather than one.