Baghdad is the capital of the Republic of Iraq, as well as the coterminous Baghdad Province. The population of Baghdad, as of 2011, is approximately 7,216,040, making it the largest city in Iraq, the second largest city in the Arab world, and the second largest city in Western Asia. According to the government, which is preparing for a census, the population of the country has reached 35 million, with 9 million in the capital.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, garnered the city a worldwide reputation as the "Center of Learning". Throughout the High Middle Ages, Baghdad was considered to be the largest city in the world with an estimated population of 1,200,000 people. According to some archeologists it was the first city to reach a population over one million inhabitants. 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 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. Though the nation continues to work toward rebuilding and reconciliation, as of 2012, Baghdad continues to be 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.