Behemoth and Leviathan are both of Babylonian origin, where they are creatures of the primal Chaos, Behemoth of the Earth and male, Leviathan of the Ocean Deep and female.
Some historians claim Behemoth, derived from Hebrew b'hemoth, usually taken as plural of intensity of b'hemah "beast.", is perhaps a folk etymology of Egyptian pehemau, literally "water-ox," the name for the hippopotamus. Bahamut is the Arabic form of Behemoth. However, the original biblical Behemoth never appeared as a fish.A reshaping of its nature must have occurred in Arab storytelling, some time in the pre-islamic period.One proposed scenario is that a pair of beasts from the bible were confused with each other; the behemoth mis-assigned to the fish, and the aquatic leviathan to the bull.
Leviathan's source is in prebiblical Mesopotamian myth, especially that of the sea monster in the Ugaritic myth of Baal. It's another name for Yam, ancient West Semitic deity who ruled the oceans, rivers, lakes, and underground springs. He also played an important role in the Baal myths recorded on tablets uncovered at Ugarit, which say that at the beginning of time Yamm was awarded the divine kingship by El, the chief god of the pantheon. One day, Yamm’s messengers requested that the gods surrender Baal to be a bond servant to Yamm. El finally agreed, but Baal refused to go and instead engaged Yamm in battle. After a furious fight, in which the craftsman Kothar supplied Baal with two special weapons, Yamm was finally slain and the kingship given to Baal. According to some scholars, Yamm was the same deity as Lotan (Hebrew: Leviathan), who was represented as a hydralike dragon or serpent.