The exact period of building this complex is not very clear.
The opinion of historians is that the temple was built as a dedication to the Shaivite beliefs of Hinduism (from the large number of Shaivaite images seen on the lintels of the main temple and in other adjoining temples).