Sumerian civilization was a loose confederation of theocratic city-states, which had monumental architecture and complex social structures. Flood control provided a flourishing agricultural economy, enhanced by manufacturing and foreign trade. Inter-city wars were common, and mini-empires arose, as one city captured some of its neighbors. Around 2350 BC the ruler of Erech, Lugalzaggissi, conquered all of Sumeria, creating an extensive empire.Despite the internecine wars, Sumerian civilization was remarkably stable for a long time. With culture and religion showing only gradual changes, some cities were inhabited for 2,000 years or more.Some scholars believe that the Sumerian Civilization ended because of the conflict with in, sort of like self dystruction. This happened because City-States would sometimes fight against each other. At the end of the 2nd millennium BCE, there was a major shift in population from southern Mesopotamia toward the north. Ecologically, the agricultural productivity of the Sumerian lands was being compromised as a result of rising salinity. Soil salinity in this region had been long recognized as a major problem. Poorly drained irrigated soils, in an arid climate with high levels of evaporation, led to the buildup of dissolved salts in the soil, eventually reducing agricultural yields severely. During the Akkadian and Ur III phases, there was a shift from the cultivation of wheat to the more salt-tolerant barley, but this was insufficient, and during the period from 2100 BC to 1700 BC, it is estimated that the population in this area declined by nearly three fifths. This greatly weakened the balance of power within the region, weakening the areas where Sumerian was spoken, and comparatively strengthening those where Akkadian was the major language. Akkadian gradually replaced Sumerian as a spoken language somewhere around the turn of the 3rd and the 2nd millennium BC (the exact dating being a matter of debate), but Sumerian continued to be used as a sacred, ceremonial, literary and scientific language in Mesopotamia (Babylonia and Assyria) until the 1st century AD; in other words, Sumerian remained only a literary and liturgical language, similar to the position occupied by Latin in medieval Europe