Located along the Tigris River, the city was founded in the 8th century and became the capital of the Abbasid Caliphate. Within a short time of its inception, Baghdad evolved into a significant cultural, commercial, and intellectual center for the Islamic world. This, in addition to housing several key academic institutions (e.g., House of Wisdom), garnered the city a worldwide reputation as the "Centre of Learning".
Baghdad was the largest city of the Middle Ages for much of the Abbasid era, peaking at a population of more than a million. The city was largely destroyed at the hands of the Mongol Empire in 1258, resulting in a decline that would linger through many centuries due to frequent plagues and multiple successive empires. With the recognition of Iraq as an independent state (formerly the British Mandate of Mesopotamia) in 1938, Baghdad gradually regained some of its former prominence as a significant center of Arab culture.
In contemporary times, the city has often faced severe infrastructural damage, most recently due to the 2003 invasion of Iraq, and the subsequent Iraq War that lasted until December 2011. In recent years, the city has been frequently subjected to insurgency attacks. The war had resulted in a substantial loss of cultural heritage and historical artifacts as well. As of 2012, Baghdad was listed as one of the least hospitable places in the world to live, and was ranked by Mercer as the worst of 221 major cities as measured by quality-of-life.
The name Baghdad is pre-Islamic, and its origin is disputed. The site where the city of Baghdad developed has been populated for millennia. By the 8th century AD, several villages had developed there, including a Persian hamlet called Baghdad, the name which would come to be used for the Abbasid metropolis.
Arab authors, realizing the pre-Islamic origins of Baghdad's name, generally looked for its roots in Persian. They suggested various meanings, the most common of which was "bestowed by God". Modern scholars generally tend to favor this etymology, which views the word as a compound of bagh () "god" and dād () "given", In Old Persian the first element can be traced to boghu and is related to Slavic bog "god", while the second can be traced to dadāti. A similar term in Middle Persian is the name Mithradāt (Mihrdād in New Persian), known in English by its Hellenistic form Mithridates, meaning "gift of Mithra" (dāt is the more archaic form of dād, related to Latin dat and English donor). There are a number of other locations in the wider region whose names are compounds of the word bagh, including Baghlan and Bagram in Afghanistan or a village called Bagh-šan in Iran. The name of the town Baghdati in Georgia shares the same etymological origins.