I agree. But I thought it was built in 1905.
I could be wrong. I thought it was very old, but if not, I defer to you. I heard it had survived all kinds of conquests and so on, but...they might have been speaking of another structure.
I saw this online:
The shrine around their tombs was developed in 944 by the Hamdanid governor Nasir ad-Dawlah and became a focus for pilgrims. It was developed and rebuilt several times in succeeding centuries,[5] including, in particular, by Arslan al-Basasiri in around 1053 and by Caliph an-Nasir li-Din Allah in 1209.
Nasir ad-Din Shah Qajar undertook the latest remodelling of the shrine in 1868, with the golden dome added in 1905. Covered in 72,000 gold pieces and surrounded by walls of light blue tiles, the dome was a dominant feature of the Samarra skyline. It was approximately 20 metres in diameter by 68 metres high.
So I think some portion of the structure (the shrine?) might be very old, but I think you are correct in that the most visible part of the mosque was built in 1905.