The story of Tiamat is told in the "Enuma Elish", the Babylonian origin myth describing the creation of the universe. At the very beginning of time, before anything else existed, there were two primordial beings. Apsu, the male, existed as a sea of sweet water (fresh water), and Tiamat, the female, existed as a sea of salt water. They gave birth to a son, Mammu, who existed as a mist above the waters.
Birth of the Gods/Death of Apsu
The waters of Apsu and Tiamat merged, and from that came the first generation of gods, Lahmu and Lahamu. Subsequent generations of gods followed, and their behavior began to disturb Apsu and Tiamat. The wishes of Apsu and Tiamat were ignored by the other gods, until Apsu finally decided to destroy them. Tiamat condemned the plan, and tried to persuade Apsu to abandon it, but Mammu agreed with Apsu and convinced him to take action.
The gods learned of Apsu's plan to destroy them. The most powerful of them, Ea, cast a spell that put Apsu into a deep sleep, and made Mammu unable to move. After taking Apsu's crown and other symbols of power, Ea killed Apsu. The sweet waters remained, but they were no longer embodied by Apsu. Ea built his home on top of the sweet waters, which he now controlled.
Birth of Marduk/Death of Tiamat
Ea and his wife Damkina then gave birth to Marduk, the most perfect and powerful of all the gods. Marduk was almost a double-god, having great strength, and four eyes and four ears, which enabled him to see and hear far more than the other gods.
A group of gods rebelled against the new order, and persuaded Tiamat avenge Apsu's death by destroying the other gods. Tiamat became turbulent, like the raging sea, and created terrible monsters to send against the gods. Most of the gods were fearful of Tiamat's wrath, but Marduk said he would face her. In return, the gods agreed to make Marduk the supreme ruler of all the gods.
In a great battle, Marduk defeated Tiamat. He then split her body in two, and used half to create the sky, and half to create the earth. The Tigris and Euphrates rivers, so crucial to life in Mesopotamia, were created when Marduk pierced Tiamat's eyes.
Marduk, now the supreme god, then created the stars, the sun and moon, and the yearly cycle in which nature renews itself on a regular, predictable basis. So that he and the other gods could live a life of ease, Marduk used the blood of Kingu, the god who had led the rebellion, to create humans, who would exist to serve the gods.
The "Enuma Elish" established several ideas that are common in later origin myths. The idea that primordial waters existed before the creation of the universe is seen in many tales, including the book of Genesis, which states that "darkness was upon the face of the deep," and says "the spirit of God was hovering over the water."
Other significant ideas in the tale are the creation of the world by imposing order on chaos, illustrated by Marduk's victory over the turbulent Tiamat, and the creation of humans by a god.
Perhaps the most significant part of story, however, is this: in defeating Tiamat, Marduk took control of the god's world from a woman, and made it male-dominated. This was seen as justification for the patriarchal model of society that existed in Babylonia, a model that has been used by much of humanity ever since.