This is the exemplary Mughal Architecture of Hazratbal Mosque built in 1623 by Sadiq Khan, the subedar of the then Mughal Emperor, Shah Jahan.
According to legend, the relic, the hair of Prophet Muhammad was first brought to Kashmir by Syed Abdullah, a purported descendant of Prophet Muhammad who left Medina and settled in Bijapur, near Hyderabad in 1635.
When Syed Abdullah died, his son, Syed Hamid, inherited the relic. Following the Mughal conquest of the region, Syed Hamid was stripped of his family estates. Finding himself unable to care for the relic, he sold it to a wealthy Kashmiri businessman, Khwaja Nur-ud-Din Eshai.
However, when the Mughal Emperor Aurangzeb came to know of what had transpired, he had the relic seized and sent to the shrine of Khwaja Moinuddin Chishti at Ajmer, and had Khwaja Nur-ud-Din Eshai imprisoned in Delhi for possessing the relic. Later, realizing his mistake, Aurangzeb decided to restore the relic to Khwaja Nur-ud-Din Eshai and to allow him to take it to Kashmir. However, Khwaja Nur-ud-Din Eshai had already died in imprisonment. In 1700, the relic finally reached Kashmir, along with the body of Khwaja Nur-ud-Din Eshai. There, Inayat Begum, daughter of Khwaja Nur-ud-Din Eshai, became a custodian of the relic and established the shrine. Since then, her male descendants have been caretakers of the relic.