A Khanqah (also spelled Khandaq or Khanqa) is a building designed specifically for gatherings of a Sufi brotherhood or tariqa and is a place for spiritual retreat and character reformation. In the past, especially in the medieval Islamic world, Khanqahs served as hospices for Sufis, ascetics, dervishes, and travellers. They were often located near a saint's tomb (dargah) or a mosque. They were centres of Sufi teaching, practices, and community life.