The history of institutions in Mesopotamia concerns the origin and evolution of institutions (economic, social or political) in the Mesopotamian civilization. Its history spans from the emergence of civilization and the existence of written records that allow History to be made until the fall of the Chaldean or Neo-Babylonian Empire, the last Mesopotamian empire.
 The origin of the institutions belonging to civilization – basically the social differentiation inherent to the division of labour and its organization on an urban scale, the construction of power in the primitive States and the establishment of institutionalized religions with temples and clergy — occurred in Mesopotamia and Egypt from the 4th millennium B.C. onwards.
 The first institutions in the Antiquity arose in Mesopotamia and are extremely unknown. They emerged in the prelude to ancient history, in Protohistory. From the 5th millennium B.C. onwards, the villages in the south of present-day Iraq revealed a progressive occupation of the Tigris and Euphrates valleys and the consolidation of agriculture and farming. The first metallurgical techniques also appeared, such as copper (Chalcolithic). The city model of this period is usually considered the preamble to the urban revolution and the first institutions are found in it. Around 4500 B.C. a building with thick walls could be found that signaled a change in society. This (institutional) building could have belonged to the whole village and played a role in a collective organization level of regularization of the relations of the inhabitants. This building indicates the transition from one society to another that required a greater organization. This phenomenon multiplied in all the villages of the south. It can be considered a temple with bureaucratic power that organized the commercial transactions and that had rooms in its interior where copper objects, remains of grain, pieces of wool have been found, it was an economic activity of local origin, also remains of ceramics and material coming from the exterior like precious stones have been found.
 From the social point of view, at the beginning of the III millennium B.C., the first great economic differences appeared (until then there were differences based on sex and age), and their consequent internal struggles. Some families held power through control of the temple. They turned part of the population into slaves and appropriated part of the production, until then collective. This aristocracy that settled around the temple created the first administrative positions. The first local institutions also arose, the Council of Elders with a juridical character, and the Assembly of men of the city with a defensive character. The first local chiefs assumed functions such as that of military chief who was the only one who could ensure political and military independence, due to the growing rivalry with neighboring cities, and monopolized the unitary power. It is necessary to emphasize the religious power that was united to the political, judicial and military power, with the customary law. It evolved towards a progressive centralization of power.
 This first phase led to another, more clearly defined phase. The first temples fulfilled an economic mission within these societies, being economically independent and self-sufficient cities. Parallel to the emergence of the temples, disputes also began between the great families, who vied for local leadership. This can be dated to around 4000-3100 B.C. and was a response to the needs of the time.
 There was a pre-state model in each village that preceded the emergence of the city-states. This model had a special boom in southern Mesopotamia with irrigated agriculture and a more advanced agricultural technology and this is where the first testimonies of writing (socio-economic writings) come from and later the phase of the first dynasties will appear.
 In the protodynastic period there was an important development in the agricultural techniques that marked a great progress, there was also a technological development, copper was substituted by bronze and also the ceramics will achieve important advances.
 There was no ethnic unity judging by the written sources. The texts of stratum 4A of Uruk and in Jemdet Nasr identify an element of Sumerian population and another of unknown origin that would inhabit the area before the Sumerians and also highlight non-Sumerian linguistic elements. From the second half of the third millennium this country of the Persian Gulf was called Sumer. To the northwest of this one the country of Akkad will appear.
 The Sumerian element was the most important element in the development and this process led to decisive changes in the formation of society. The cities were walled and even the temples within the city itself were walled. Associated with these temples was a priestly caste that commanded them and had great power that was based on a broad economic control. The first texts were written in these temples. In the stratum 4A of Uruk around 3100 B.C. there are more than 4000 texts that come from the great temple of Uruk and recorded the economic and commercial activities of the temple.
 These economic texts reveal data of an institutional regulation and provide specific data on areas of cultivated fields, farming and exportation, and transportation. In some later documents there is evidence of a series of names of professions that reveal an organization of the craftsmanship through a specialization of functions. According to these data, not only craft work but also trade was linked to the administration of the temple. There is also evidence of a large-scale trade that provided the importation of mainly luxury goods, raw materials coming from distant regions.
 This import capacity transformed the growing potential of the temples (economic) that surely allowed them to maintain this exchange for a long time, which reveals their economic self-sufficiency that seems to export agricultural products, fishing, textile and farming production. This process could not exist without a numerous group of people specialized in the commerce that were denominated Dam-Gár that are the first known merchants and appear mentioned in the texts of Uruk and Jemdet Nasr. It is considered the function of these institutional merchants that makes possible the human relations with an organization and within this movement of the merchants it is necessary to emphasize the private activity of the same ones. It was clear that they are intermediaries of the temples in the outside and would be used in their external relations.
 The cities were acquiring more importance in the south of Sumer and were consolidated as city-states. There were also city-states in Syria. For various reasons, economic competition between cities and military clashes multiplied and are documented in textual documents. The warrior spirit emerged as a novelty and the cities were walled and it was an important feature of the first dynasties around 2700 B.C. The need to concentrate military power for defense gave rise to hereditary kingship. And as consequence these kings occupied important functions of cult and progressive submission of the temples to these kings that are of those great families of the protodynastic period before mentioned, that began to stand out at that time. This royalty was distributed throughout all the city-states, assuming the centralist political power by a single person who took charge of the temples and their economic reform.
 The assembly of freemen and the council of elders continued to support the king so that the royal power was not absolute. In spite of the subjection these institutions recognized the primacy of the king to whom they assisted in decisions and supported him, the king did not decide alone. The independence of monarchical power is consolidated according to the sources. Around 2700 B.C., written documents of a royal title appeared in Sumer (En) and this title began to represent a status. Parallel to the title of 'en' appeared the first writings of the institution of the palace (Egal) that are found in the most archaic texts of Ur. From the archaeological point of view the first particularly large buildings were found in the city of Kiš and Eridu. Around 2600 B.C. a number of tombs were found in Ur, which show by their grave goods that they are kings and show the growing position of the kingship supported by a partly religious ideology.
 Towards 2700 B.C. the title diversified because the title of  en is joined to that of lugal and ensi. It seems that this diversification corresponds to a dialectization of Sumerian, subsequently the title of En disappeared, lugal is the king and ensi a subordinate of lugal. The degree of importance of kingship as an institution increases on the horizon of the city-states, later the king will be deified. Although at this time the kingship had not yet been deified, it was associated with a divine origin and a special relationship to the cult. These local chiefs found their location in the fact that royalty descended from heaven, was above society and resided in the palaces, strengthening their economic resources by taking advantage of the historical conjuncture and through buying and selling.
 Rivalries between the city-states produced that the city of Kiš and its monarchy in the Proto-Dynastic period became the most important as the Sumerian royal list shows and the title of king of Kish becomes generalized, but despite this primacy the struggles of cities gave rise to a series of Sumerian leagues and coalitions whereby kings unite to defend common interests but the picture of political history remains largely obscured.
 The documents are royal texts that provide little information. If it is known that from this protodynastic phase around 2500 B.C. a king appeared in Lagash, accepting the title of king of Kiš and hints that this king named Eannatum would have achieved a primacy in Sumer and to assert this power over other cities he had his victories recorded on various tablets. There are also economic texts that come from the palaces and mention the distribution of power on a local scale. According to these documents the best reflected are the properties of the temples that are farmland and properties of the gods and form a considerable part of the land available for exploitation. A Lagash temple controlled 50% of the irrigated territory. The royal institution was strengthened by usurping from these temples their properties and collective ownership. The absolute power of the kings was not such. The royal institution controlled from 2500 B.C. onwards the economic units of state character, the temples, the river ports and land routes. In the Protodynastic period, the palace structure was highly developed and controlled two areas:
 Productive lands belonged to the state organization. The distribution was tripartite:
 This model of state organization was controlled by the palace, which enriched itself abusively at the expense of others, expropriated the property of the temples and citizens, which led to a progressive impoverishment of the city. This abuse of the palace provoked revolts that caused a political change. It was the time of reform of Uruk Agina in 2350 B.C. who came to power by a coup d'état and already on the throne enacted legal measures aimed at returning property to the temples and the people. His aim was to abolish the despotism of the palaces and their officials. He also regulated the taxes of the inhabitants for weddings, divorces, burials, and so on. The reform favored the most disadvantaged, put an end to debts, improved the condition of slaves and even freed some of them. A legal guarantee is given that regulates the relations between institutions and people and between the temple and the palace. All this meant a new social justice in a primitive state that served as a reference to other later kings. This reform reduces the social tension and allows a general improvement of the economy and especially of the most disadvantaged. The royalty and the temple are established in a concrete legislation but it was not clear how far the temples managed to recover their position.
 The Protodynastic period ends with the period of Uruk Agina and with the struggles between cities to impose themselves on each other and in this context appeared Lugal Zagesi who was prince of Umma and became king of Uruk and imposed at the end of his reign his sovereignty in all the south of Mesopotamia, in a great territorial State, Sumer. This enormous extension of land demonstrates the enormous power of the palace as an institution since he was not sovereign of a city but of a state.
 The first legal documents emerged with the beginning of writing and regulated the purchase and sale of land and its derived obligations. They are contracts that dictated the rules of operation of a currently partially known legality.
 It was very important among the parties of the contract to rely on witnesses who formed the institution that attested that a transaction is carried out within the law, it is the customary law and appear at the end of the contract, they are free citizens, mostly family members. The formation of this document of sale and purchase usually has a fixed speech as they were very common. Most of the documents were of sale and purchase and were not regulated by the central power, we know them from the archives of the palaces. This private law comes from custom and was a recognized practice.
 The historical evolution of Mesopotamia brought decisive changes in society and in this process of change, the royalty became more powerful against the priests and aristocrats. The old pre-existing institutions, the council of elders and the assembly of free men with a pseudo-democratic character became secondary. As a consequence of the rise of the monarchy, the palace acquired more power by incorporating the temples into its economic structure. Political power became a link in the structure of a territorial state, the sovereign of a great state based in one of the ancient city-states, which would change according to its importance. The lugal was assisted by an apparatus of great officials, it was a unique monarchy that had a centralization of power that made the administration possible.
 Lugal-Zagesi became the first king of all Mesopotamia (Sumer), this domain corresponds to a military conquest that allowed him to adopt the title of king of Uruk and king of Sumer. To keep the whole state together, Lugal-Zagesi declared:
 I have made the trade routes from the upper sea to the lower sea run safely. After 25 years, the successes of Lugal-Zagesi ended because in the north was Sargon, who managed to found the longest lasting kingdom until then with capital in Agade or also called Akkad, would be the kingdom of Akkad, became king of Sumer and Akkad. He inaugurates a powerful dynasty, the most powerful of all times in Mesopotamia, of military character, the Sargonid that had to defend itself from the hostility of its enemies. From the time of Sargon, the royal institution reached new heights of power.
 Sargon founded in 2340 B.C. a kingdom more powerful and extensive than that of Lugal-Zagesi in the country of Akkad and it would last a century. He also conquered Syria and Elam, comprising almost all of Mesopotamia, although Syria does not seem to have belonged to the dynasty of Sargon or Ishtar, which is of a military character that throughout its history had to defend itself from permanent hostility. It was a period in which the royal institution reached heights of power that had not occurred before. Among the most important kings was Naram Sin.
 The main institutional characteristics are a centralized administration. This centralization of power to sustain itself needs a broad network of officials to articulate power and needs an extraordinarily powerful army without precedent. Many of these officials are trusted by the king and sons of Akkad. In the country of Sumer, during Sargon's conquest in the city-states there were ensis or lugals who now became mere governors in the service of the king who depended on the imperial directives of the new power. As in Egypt, sometimes relatives were placed at the head of the cities as governors or officials, thus ensuring loyalty and stability.
 Priesthood was also documented in temples that could be carried by people of the royal family, which reflects a direct political influence in cult areas. It reveals the executive capacity to control the temples with direct influence over the population.
 The palace of Akkad was extraordinarily powerful, controlled a large territory and was a complex and developed economic unit, 5,400 people had jobs in the palace, economic activities, courtiers, personal army and harem. In addition, within the palace there are artisans and weavers who worked strictly for the palace.
 The kings, as the highest institution, reached in this period new dimensions that from now on the principle of absolute power is imposed as fundamental nucleus of the State and the kings have maximum attributions in the State and the intervention of the power of the aristocrats and priests is reduced in a considerable way, example of this encumbrance is that Naram Sin and Shar-Kali-Sharri became deified as gods of State and this brought them a characterization as protector god of the country but without being linked to any center of cult. And this god-king reigned for the welfare of the country.
 Some legal documents of this time include the fact of adding the forms of oath in the name of the king, documented since Naram Sin. As manifestation of the supreme power, a new title is used, king of the four regions of the world (king of the universe), the local horizon of the previous tradition is surpassed. The administrative structure was headed by the palace and it was based on the submission and services of the other institutions, emphasizing those of the temples and their economic activities. The purchase of lands increased, which increased the power of the kings so that the palace became the beneficiary of the system.
 This patrimony was necessary to maintain the organization of the system, it is distributed to the palace officials who established them in the production. An example is the Obelisk of Manistusu, documenting 330 hectares bought from 98 people, a survival of private property. There was a wide commercial activity and business that benefited from the conquests of the time. The figure of the merchant stands out that allows the access to products, many of them act in a public and private capacity.
 There were disputes for territorial primacy, most notably the figure of Ur Namma (2100 B.C.) who regained the title of king of Sumer and Akkad. A structural reorganization was required based on the centralist model. It was not an economically favorable period but canals were built, there were improvements in transportation and new lands were cultivated. The structure of the State was reorganized introducing a provincial division through the old city-states with capital in Ur, but this collided with problems of adaptation due to the defense of the particularism of Sumer. King Sulgi (2093-2046 B.C.) arrived with the most important reign of Ur and consolidated the administrative apparatus of the State.
 At this time the figure of the king remained very powerful and the proof is the sophistication of the means of control. The administration of the State had a high level of development of calculation and very sophisticated registration. The political and economic power was in the hands of the king who was a god protector of the country, a divinization that can be seen especially in Sulgi, with numerous hymns to the king that praised him as wise and protector of art and justice.
 Of the structures of the institutions it is possible to say that Ur III had a very complex administrative apparatus that had at the top the Neo-Sumerian king, then there were the ensi and at the same level the military governors (sakanaku) that were in the strategic cities and could be a hereditary title like the ensi but not officially. The king could not prevent large families from controlling certain sectors as in Nippur or Umma and within this provincial jurisdiction there were members of the royal family with direct involvement in the central power.
 The daughters of Sulgi and Ur-Namma were priestesses of important temples and Sulgi's brother was priest of Innana of Ur and the royal family controlled several temples.
 Many texts of legal order, marriage, buying and selling, loans, inheritance, and so on, are documented. There was a socially accepted code of rules of customary origin. The procedure of the oath was integrated into the practice and was sworn by the king or by a divinity. This type of procedure had the character of a promise, although there was also an oath of affirmation, which was less binding. Both oaths served as a guarantee of honesty.
 The first written code of laws of the history appeared, that of Ur Namma that was a list of norms although fragmented. It had three sections, the first of theological inspiration, the second of historical character and the third was ethical-moral with the principles that regulated Mesopotamia. Only the last two sections are preserved. It serves as information on the criteria of Ur Namma. There was a decrease in economic problems, an establishment of law and measures to stabilize economic life. It ends with the same words as that of Uruk Agina.
 The capital crimes (robbery and murder) were punished with the death penalty as well as the regulation of marriages: rape, ill-treatment, divorce and adultery. The family of those sentenced to death carried the economic penalties, and later on, theft would not be punishable by death.
 The application of the Law has a fundamental role, with the King imposing justice assisted by officials under the supervision of the ensis. There was also the figure of the judge who formed a group that adopted measures, they were not professionals. In the smaller communities there were the maski, who were commissioners.
 There is a private dimension that refers to the operation of laws for poor people such as marriage regulation. There are also slaves with their own regulation with their own juridical status, they could marry free women, be witnesses, and so on.
 According to the code of Ur Namma, in the inheritance there was not great difference with the present one, since it was recognized in benefit of the carnal or adopted children of the marriage. There was a difference between sons and daughters, the daughters only inherited if there was no male, if there was a male, he inherited the totality of the goods.
 Although there were exceptions such as in the case of the death of the father of the family, the woman had no right to inherit according to the code, although according to other legal texts she would eventually inherit. It also highlights the text of Nippur that establishes that the inheritance was divided equally between wife and children. The code of Ur Namma and other legal texts externalize regulations that would not always end up being resolved but allowed the reconstruction of inheritance in this society.
 It can be concluded that the practice of law in Ur III responds to a norm that is typical of the social class and understands the Law as a function of the distribution of wealth, having a conservative character.
 It is also necessary to recognize an institution of cultural character that was the School of Tablets, which was on the margin of the others. Its role was the development of culture, these schools have made it possible to settle certain areas of knowledge, because it was through them that things like registration, medical literature, early mathematics, early astronomical knowledge, encyclopedias, myths, and so on. The evolution of the Schools of Tablets developed into libraries.
 The structures survived but there were innovations from the point of view of the social and juridical regulations. From the juridical point of view, from that moment and emphasized with the arrival of the Amorites, the existence of three new codes of laws: