The history of Sumer, taken to include the prehistoric Ubaid and Uruk periods, spans the 5th to 3rd millennia BC, ending with the downfall of the Third Dynasty of Ur around 2004 BC, followed by a transitional period of Amorite states before the rise of Babylonia in the 18th century BC.
The first settlement in southern Mesopotamia was Eridu. The Sumerians claimed that their civilization had been brought, fully formed, to the city of Eridu by their god Enki or by his advisor (or Abgallu from ab=water, gal=big, lu=man), Adapa U-an (the Oannes of Berossus). The first people at Eridu brought with them the Samarran culture from northern Mesopotamia and are identified with the Ubaid period, but it is not known whether or not these were Sumerians (associated later with the Uruk period).
The Sumerian king list is an ancient text in the Sumerian language listing kings of Sumer, including a few foreign dynasties. Some of the earlier dynasties may be mythical; the historical record does not open up before the first archaeologically attested ruler, Enmebaragesi (ca. 2600 BC), while conjectures and interpretations of archaeological evidence can vary for earlier events. The best-known dynasty, that of Lagash, is omitted from the kinglist.
Permanent year-round urban settlement may have been prompted by intensive agricultural practices. The work required in maintaining irrigation canals called for, and the resulting surplus food enabled, relatively concentrated populations. The centres of Eridu and Uruk, two of the earliest cities, had successively elaborated large temple complexes built of mudbrick. Developing as small shrines with the earliest settlements, by the Early Dynastic I period, they had become the most imposing structures in their respective cities, each dedicated to its own respective god. From south to north, the principal temple-cities, their principal temple complex, and the gods they served, were