Sāmarrā ( Arabic : سامَرّاء ) is a city in Iraq . It stands on the east bank of the Tigris in the Saladin Governorate , 125 kilometers (78 mi) north of Baghdad . In 2003 the city had an estimated population of 348,700. Samarra was once in the " Sunni Triangle " of violence during the sectarian violence in Iraq (2006–07) .
In the medieval times, Samarra was the capital of the Abbasid Caliphate and the only remaining Islamic capital that retains its original plan, architecture and artistic relics.  In 2007, UNESCO named Samarra one of its World Heritage Sites . 
The remains of prehistoric Samarra were first excavated between 1911 and 1914 by the German archaeologist Ernst Herzfeld . Samarra became the type site for the Samarra culture . Since 1946, the notebooks, letters, unpublished excavation reports and photographs have been in the Freer Gallery of Art in Washington, DC.
A city of Sur-marrati (refounded by Sennacherib in 690 BC according to a stele in the Walters Art Museum ) is insecurely identified with a fortified Assyrian site of Assyrian at al-Huwaysh on the Tigris opposite modern Samarra. The State Archives of Assyria Online identifies Surimarrat as the modern site of Samarra. 
Ancient place names for Samarra noted by the Samarra Archaeological Survey are Greek Souma ( Ptolemy V.19, Zosimus III, 30), Latin Sumere , a fort mentioned during the retreat of the army of Julian in 363 AD ( Ammianus Marcellinus XXV, 6, 4), and Syriac Sumra (Hoffmann, Auszüge , 188; Michael the Syrian , III, 88), described as a village.
The possibility of a larger population was offered by the opening of the Qatul al-Kisrawi, the northern extension of the Nahrawan Canal which drew water from the Tigris in the region of Samarra, attributed by Yaqut al-Hamawi ( Muʿjam , see under "Qatul") to Khosrau I (531–578). To celebrate the completion of this project, a commemorative tower (modern Burj al-Qa'im) was built at the southern inlet south of Samarra, and a palace with a "paradise" or walled hunting park was constructed at the northern inlet (modern Nahr ar-Rasasi) near ad-Dawr . A supplementary canal, the Qatul Abi al-Jund, excavated by the Abbasid Caliph Harun al-Rashid , was commemorated by a planned city laid out in the form of a regular octagon (modern Husn al-Qadisiyya), called al-Mubarak and abandoned unfinished in 796.
In 836 CE , the Abbasid Caliph Al-Mu'tasim founded a new capital at the banks of the Tigris. Here he built extensive palace complexes surrounded by garrison settlements for his guards, mostly drawn from Central Asia and Iran (most famously the Turks , as well as the Khurasani Ishtakhaniyya , Faraghina and Ushrusaniyya regiments) or North Africa (like the Maghariba ). Although quite often called Mamluk slave soldiers, their status was quite elevated; some of their commanders bore Sogdian titles of nobility.
The city was further developed under Caliph al-Mutawakkil , who sponsored the construction of lavish palace complexes, such as al-Mutawakkiliyya, and the Great Mosque of Samarra with its famous spiral minaret or Malwiya, built in 847. For his son al-Mu'tazz he built the large palace Bulkuwara.
Samarra remained the residence of the caliph until 892, when al-Mu'tadid eventually returned to Baghdad. The city declined but maintained a mint until the early 10th century.
The Nestorian patriarch Sargis (860–72) moved the patriarchal seat of the Church of the East from Baghdad to Samarra, and one or two of his immediate successors may also have sat in Samarra so as to be close to the seat of power.
During the long decline of the Abbasid empire, 940 Samarra was largely abandoned starting in AD 940. Its population returned to Baghdad and the city rapidly declined. Its field of ruins is the only world metropolis of late antiquity which is available for serious archaeology.
The city is also home to al-Askari Shrine , containing the mausolea of the Imams Ali al-Hadi and Hasan al-Askari , the tenth and eleventh Shiʿi Imams , respectively, as well as the place from where Muhammad al-Mahdi , known as the "Hidden Imam", reportedly went into The Occultation in the belief of the Twelver or Shias . This has made it an important pilgrimage centre for the Imami Shias. In addition, Hakimah and Narjis , female relatives of the Muhammad and the Imams, held in high esteem by Muslims, are buried there, making this mosque one of the most significant sites of worship.
The Sunnis also pray in the mosques similar to the Shi'a; they also conduct pilgrimages to these sites, coming as far as from South and Southeast Asia , but they do not believe this to be obligatory, but rather an affair providing spiritual blessings.
In the eighteenth century, one of the most violent battles of the 1730–1735 Ottoman–Persian War , the Battle of Samarra , took place, where over 50,000 Turks and Persians became casualties. The engagement decided the fate of Ottoman Iraq and kept it under Istanbul's suzerainty until the First World War.
During the 20th century, Samarra gained new importance when a permanent lake, Lake Tharthar , was created through the construction of the Samarra Barrage , which was built in order to prevent the frequent flooding of Baghdad. Many local people were displaced by the dam, resulting in an increase in Samarra's population.
Though Samarra is famous for its Shi'i holy sites, including the tombs of several Shi'i Imams, the town was traditionally and until very recently, dominated by Sunni Arabs. Tensions arose between Sunnis and the Shi'a during the Iraq War. On February 22, 2006, the golden dome of the al-Askari Mosque was bombed , setting off a period of rioting and reprisal attacks across the country which claimed hundreds of lives. No organization claimed responsibility for the bombing. On June 13, 2007, insurgents attacked the mosque again and destroyed the two minarets that flanked the dome's ruins.  On July 12, 2007, the clock tower was blown up. No fatalities were reported. Shiʿi cleric Muqtada al-Sadr called for peaceful demonstrations and three days of mourning.  He stated that he believed no Sunni Arab could have been behind the attack, though according to the New York Times the attackers were likely Sunnis linked to Al-Qaeda. The mosque compound and minarets had been closed since the 2006 bombing. An indefinite curfew was placed on the city by the Iraqi police.  
Ever since the end of Iraqi civil war in 2007, the Shia population of the holy city has increased exponentially. However, violence has continued, with bombings taking place in 2011 and 2013 . In June 2014, the city was attacked by the Islamic State of Iraq and the Levant (ISIL) as part of the Northern Iraq offensive . ISIL forces captured the municipality building and university, but were later repulsed.
In popular culture
The metaphor of "Having an appointment in Samarra", signifying death, is a literary reference to an ancient Babylonian myth recorded in the Babylonian Talmud and transcribed by W. Somerset Maugham ,  in which Death narrates a man's futile attempt to escape him by fleeing from Baghdad to Samarra. The story "The Appointment in Samarra" subsequently formed the germ of a novel of the same name by John O'Hara .  The original story was retold in verse by F. L. Lucas in his poem "The Destined Hour" in From Many Times and Lands (1953).  The story is told in " The Six Thatchers ", a 2017 episode of Sherlock .