The Gyanvapi mosque is located in Varanasi. It was constructed by the Mughal Emperor Aurangzeb. It was built after destroying a Hindu temple. The remnants of the Hindu temple can be seen on the walls of the Gyanvapi mosque. The demolished temple is believed by Hindus to be an earlier restoration of the original Kashi Vishwanath temple.
The mosque is named after a well, the Gyan Vapi ("the well of knowledge"), which is located within the mosque precincts. The legends mentioned by the Hindu priests state that the lingam of the original temple was hidden in this well, when the temple was destroyed.