Urban civilizations first developed around the 4th millennium BC in the river valleys and plains of Egypt and Mesopotamia along the Nile, Tigris, and Euphrates Rivers, which had fertile soils. This transition from villages to cities, known as the urban revolution, was characterized by abundant crop surpluses that fed urban populations and were traded, a hierarchical society divided into rulers, soldiers, priests, farmers, and artisans, and an advanced culture facilitated by the invention of writing. Power was centered around kings and pharaohs who possessed absolute authority over the political and administrative organizations.