They travel to the city to worship at the sacred tombs of Ali al-Hadi and al-Hasan al-Askari, the 10th and 11th Shia Imams, and the site where the 12th Imam, Mohammed al-Mahdi, disappeared.
Imam al-Mahdi, known as the “hidden Imam”, was the son and grandson of the two previous imams, and Shias pray at the mosque for his return.
Al-Hadi, the 10th Shia Imam, was born in Medina in modern-day Saudi Arabia in 827. He became Imam at the age of six.
In 848, he and his son were brought to Samarra, then the capital of the Abbasid Empire and placed under house arrest by the Caliph al-Mutawakkil.
In addition to the tombs of the two imams, are those of Hakima Khatun, the sister of Imam al-Hadi, and Narjis Khatun, the mother of Imam al-Mahdi.
The huge complex also contains a second shrine above the cave (sirdab), where the young Imam al-Mahdi, Al-Askari’s son, was said to have been hidden before he disappeared in 878.
Not accepting that he died, Shias still await his return more than 1,100 years later.
Visitors descend stairs to enter the sirdab, which bears an 800-year-old inscription from the Abbasid Caliph Nasser al-Din Allah.
The huge complex was first developed during the 10th and 11th Centuries by the Shia Hamdanid and Buyid dynasties, and soon became an important place of pilgrimage.
The complex was rebuilt several times, most recently in 1905, when a gold-plated dome was erected above the tomb of the two imams. The dome was covered by 72,00 golden pieces and measured roughly 20m wide and 68m high.
A blue-tiled dome also marks the sirdab where Imam al-Mahdi disappeared.
Robert Hillenbrand, the professor of Islamic Art at Edinburgh University, told the BBC that the shrine may not be of enormous architectural importance, but is of immense spiritual importance for hundreds of millions of Shia Muslims.
In a Christian context, he said, the shrine would equate in spiritual importance to the burial place of St James at Santiago de Compostela.
“Pilgrimage to such shrines, of which the majority are in Iraq, is an absolutely integral part of their religious life,” he added.
The other three major Shia shrines in Iraq are Najaf, Karbala and Kadhimiya in Baghdad.