The site of the mosque was originally a Sanskrit college building commissioned by Vigraharaja IV (alias Visaladeva), a king of the Shakambhari Chahamana (Chauhan) dynasty.
The original building was square-shaped, with a tower-chhatri (dome-shaped pavilion) at each corner.
A temple dedicated to Sarasvati was located on the western side.
A tablet dated to 1153 CE was found at the site in the 19th century; based on this, it can be inferred that the original building must have been constructed sometime before 1153 CE.
According to the local Jain tradition, the building was originally constructed by Seth Viramdeva Kala in 660 CE as a Jain shrine to celebrate Panch Kalyanaka.

The relics in the modern building show both Hindu and Jain features.
According to KDL Khan, the building materials were taken from Hindu and Jain temples.
According to Caterina Mercone Maxwell and Marijke Rijsberman, the Sanskrit college was a Jain institution, and the building materials were taken from Hindu temples.
ASI Director-General Alexander Cunningham hypothesized that the pillars used in the building were probably taken from 20–30 demolished Hindu temples, which featured at least 700 pillars in total.
Based on the pillar inscriptions, he concluded that these original temples dated to 11th or 12th century CE.
The site of the mosque was originally a Sanskrit college building commissioned by Vigraharaja IV (alias Visaladeva), a king of the Shakambhari Chahamana (Chauhan) dynasty. The original building was square-shaped, with a tower-chhatri (dome-shaped pavilion) at each corner. A temple dedicated to Sarasvati was located on the western side. A tablet dated to 1153 CE was found at the site in the 19th century; based on this, it can be inferred that the original building must have been constructed sometime before 1153 CE. According to the local Jain tradition, the building was originally constructed by Seth Viramdeva Kala in 660 CE as a Jain shrine to celebrate Panch Kalyanaka.
The relics in the modern building show both Hindu and Jain features. According to KDL Khan, the building materials were taken from Hindu and Jain temples. According to Caterina Mercone Maxwell and Marijke Rijsberman, the Sanskrit college was a Jain institution, and the building materials were taken from Hindu temples. ASI Director-General Alexander Cunningham hypothesized that the pillars used in the building were probably taken from 20–30 demolished Hindu temples, which featured at least 700 pillars in total. Based on the pillar inscriptions, he concluded that these original temples dated to 11th or 12th century CE.
Adhai Din Ka Jhonpra