The Sumerians practiced a polytheistic religion, with anthropomorphic gods or goddesses representing forces or presences in the world, in much the same way as later Greek mythology. According to said mythology, the gods originally created humans as servants for themselves but freed them when they became too much to handle.
Many stories in Sumerian religion appear similar to stories in other Middle-Eastern religions. For example, the Biblical account of the creation of man as well as Noah's flood resemble the Sumerian tales very closely, though the Sumerian myths were written many centuries earlier than the Tanakh. Gods and Goddesses from Sumer have distinctly similar representations in the religions of the Akkadians, Canaanites, and others. A number of stories and deities have Greek parallels as well; for example, it has been argued by some that Inanna's descent into the underworld strikingly recalls (and predates) the story of Persephone.
Each walled city of Mesopotamian civilization in early times was centred upon a temple complex or ziggurat, including the state granary. Archaeology has shown that these temples grew from modest shrines that were associated with the earliest unwalled levels of settlement about 4500 BC. Initially the shrines were basically an elevated yard surrounding a small building of wood and branches where people came to offer tributes to Namma, the mother goddess, or An, the sky lord. The structures were later covered in mud and then bricks of burned material, and as the villages and towns where these shrines were built grew, so did the shrines. The yard was surrounded with a brick wall, which later turned to be the shrine's outer bulwark. As the towns grew into City-states, the shrines were destroyed, the site flattened, and a larger temple was built upon it. This gradually raised the temples above the level of the surrounding buildings, so that eventually a temple platform (ziggurat or later zikkorath') was constructed, raising the temple towards the heavens - possibly the origin of the biblical story the Tower of Babel. Temples were called the E'kur or "High House" (E = house, Kur = Mound, at Nippur) or E'anna (House of Heaven, E = house, Anu = Heavens, sky at Uruk). The ziggurats were elevated stair-towers, somewhat like the shape of a pyramid stretched upwards, with each level being devoted to one of the known stars of that time, to the sun or moon or to some gods, with the main part of the shrine on the roof, which was a flat surface on which ceremonies were conducted. The ziggurats were considered a place closer to the heavens, a gateway and shrine to the gods and a place for the ruler god of the sky (An in Sumer, Marduk in Babylon and Ashur in Assyria) to lay his feet upon.
In the historical period, each temple was under the control of an Ensi (male for female divinities, female for male divinities) associated with a named male or female god, complete with a temple staff and functionaries who not only conducted the important civic rituals, such as the sacred marriage of the New Year Festival, but in some way "acted out" important cosmological events of the seasonal cycle. The Ensi were also responsible for organising the considerable economic affairs associated with the temple. Literacy seems to have emerged as a requirement of the complexities of temple book-keeping.
As it was believed that the sacred realm mirrored the profane, wars between cities on Earth were seen as paralleling struggles between the divinities in heaven. Associations between the movements of the planets and earthly events were carefully collected, and came to be resources associated with limmu lists for compiling important historical events, and which has been developed into "Chaldean" astrology.
Each shrine was named after a single god, and with the development of the wide ranging Sumerian civilisation these gods became part of a Pantheon or single family of divinities, known as the Annunaki (Anu = Heaven, Na = And, Ki = Earth). Rather than Anu being seen as "the god" of the heavens, he was the heavens. In this way to the earliest Sumerians, humankind lived inside a living divine realm.
With the growth in size and importance of the temples, so the temple functionaries (priests = Sumerian sanga) grew in importance in their communities, and a hierarchy developed led by the En, or chief priest. Thus the chief priest of the God of Air (Lil) at the E-kur temple at the city of Nippur became "Enlil", and gods became more and more anthropomorphic.
As social complexity in these cities increased, each god came to resemble a human monarch (Lugal, Lu = Man, Gal = Big), or high priest (Ensi, En = Lord, Si = Country), complete with a family and a court of divine stewards and servants. Wars between cities were seen to reflect wars in heavens between the gods.
Minor gods were seen as family members of these major divinities. Thus Ereshkigal (Eresh = Under, Ki = Earth, Gal = Great) came to be seen as the sister of Inanna, and she came to acquire a husband too, originally Gugalanna, the Wild Bull of Heaven, (from Gu = Bull, Gal = Great, Anu = Heaven), and subsequently Nergal, the Lord of Death, son (Aplu) of Enlil and Ninlil. Servants also became minor divinities, as Isimud the two faced androgynous Steward of Enki; or Ninshabur (Lady Evening) the chief lady-in-waiting of Inanna.
Divinities then proliferated, with there being specific gods of tooth-ache, or aching limbs, goddesses for "Greenery" and "Pasture". Every aspect of life thus came to be surrounded with its own minor divinity that required gifts or placation, as magic spells multiplied, trying to give people certainty in very uncertain times.
the other visible planets were also associated with divinities Thus
Mesopotamian cosmology seems to have been seen as a genealogical system of binary opposites being considered as male and female, and, through sacred marriage or hieros gamos, giving birth to successive generations of divinities. The universe first appeared when Nammu, a presumably formless abyss, curled in upon herself, giving birth to the primary gods. According to the Babylonian Enuma Elish, the primary union divided into Tiamat, (from Sumerian Ti=Life, Ama=mother, t (Akkadian, a feminine terminal marker)) a salt water divinity, and Apsu (earlier Abzu from Ab=water, Zu=far) a fresh water divinity. These in turn gave birth to Lahamu and Lahmu, called the "muddy" or "the hairy ones", the title given to the gatekeepers of the E'Abzu temple in Eridu, who gave birth to Anshar (Sky Pivot (or Axle)) and Kishar (Earth Pivot (or Axle)) possibly referring to the celestial poles, and considered the parents of Anu (the Heaven-dome god) and Ki (the Earth god). These Gods gave their name to the Mesopotamian pantheon.
The union of An and Ki produced Enlil, who in the Sumerian period eventually became leader of the pantheon. After the banishment of Enlil from Dilmun (the home of the gods) for raping Ninlil, Ninlil had a child, Sin (god of the moon), also known in Sumerian as Nanna - Suen. Sin and Ningal gave birth to Inanna and to Utu (Sumerian) or Shamash (Akkadian). During Enlil's banishment, he fathered three "substitute" underworld deities with Ninlil , most notably Nergal.
Nammu also gave birth to Enki. Enki also controlled the Me until Inanna took them away from Enki's city of Eridu to her city of Uruk. The "me" were holy decrees that governed such basic things as physics and complex things such as social order and law. Their transfer from Eridu to Uruk may reflect ancient political events in Southern Iraq, in the Jemdet Nasr or Early Dynastic Period of Sumer.
In the much later Enuma Elish, of Babylon, it describes the chaos status in which Tiamat and Apsu, upset by the chaos of the younger gods, attempt to take back creation, until the son of Enki, Marduk, defeated them and re-created the world out of Tiamat's bodies. These myths seem to have in earlier Sumerian versions had Enlil, as god of the Winds and head of the Sumerian pantheon, in the role of Marduk. The purpose of Enuma Elish, composed in the Kassite period was to elevate Marduk, god of the city of Babylon, and make him pre-eminent amongst the old gods, thus demonstrating Babylon's political victory over the old cultures of Sumer and Akkad. In Assyrian myth, Asshur takes the place of Marduk.
Other myths tell of the creation of humankind. The younger Igigi gods go on strike, refusing the work of keeping the creation working and the gods consulted Enki for a solution. He suggested humankind be made from clay, mixed with the blood of the captured God Kingu, son and consort of Tiamat.