The Kandariya Mahadeva temple was built during the reign of Vidyadhara (r. c. 1003-1035 CE). At various periods of the reign of this dynasty many famous temples dedicated to Vishnu, Shiva, Surya, Shakti of the Hindu religion and also for the Thirthankaras of Jain religion were built. Vidhyadhara, also known as Bida in the recordings of the Muslim historian Ibn-al-Athir was a powerful ruler who fought Mahmud of Ghazni in the first offensive launched by the latter in 1019. This battle was not conclusive and Mahmud had to return to Ghazni. Mahmud again waged war against Vidhyadhara in 1022. He attacked the fort of Kalinjar. The siege of the fort was unsuccessful. It was lifted and Mahmud and Vidhyadhara called a truce and parted by exchanging gifts. Vidhyadhara celebrated his success over Mahmud and other rulers by building the Kaṇḍāriyā Mahādeva Temple, dedicated to his family deity Shiva. Epigraphic inscriptions on a pilaster of the mandapa in the temple mentions the name of the builder of the temple as Virimda, which is interpreted as the pseudonym of Vidhyadhara. Its construction is dated to the period from 1025 and 1050 AD.