
The story of the founding of the shrine indicates that, shortly after the murder of Ali and the burial of his body at Najaf, near Baghdad, some of Ali's followers worried that his body would be desecrated by his enemies, and they placed his remains on a white female camel.
According to tradition, Mazari Sharif owes its existence to a dream. At the beginning of the 12th century, a local mullah had a dream in which Ali bin Abi Talib, the prophet's cousin and son-in-law and first Shia Imam and one of the four Rightly Guided Caliphs appeared to reveal that he had been secretly buried near the city of Balkh.
Some of the artwork on the Blue Mosque. The Seljuq dynasty sultan Ahmed Sanjar rebuilt the first shrine at this location. it was destroyed by Genghis Khan in the invasion around 1220. It was rebuilt in the 15th century by Husain Baiqara.
reference