It is one of the largest step-wells or baolis in and around Mehrauli.
It was built during the reign of Emperor Iltutmish of the Slave dynasty.

The baoli is known as Gandhak ki Baoli because of its waters smell like gandhak, which means sulphur.

Another version of the legend says that the Holy Prophet appeared in a dream not only to Iltumish but also to the sufi saint Khawaja indicating the same location where the hoof print of Prophet's horse was imprinted. 
Jahaz Mahal was built on the eastern edge of the same reservoir during the Lodi dynasty period in the 16th century as a retreat or Inn for use by the pilgrims. 