Khajuraho was once the capital of the Chandela dynasty. The Kandariya Mahadeva Temple, one of the best examples of temples preserved from the medieval period in India, is the largest of the western group of temples in the Khajuraho complex which was built by the Chandela rulers. Shiva is the chief deity in the temple deified in the sanctum sanatorium. The Kandariya Mahadeva temples were built during the reign of Vidyadhara. 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, who is credited with building the Kandariya Mahādeva Temple, 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 Kandariya Mahadeva Temple, dedicated to his family deity Shiva. Epigraphic inscriptions on a pilaster of the mandapa in the temple mention 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 between 1025 and 1050 AD. All the extant temples including the Kandariya Mahadeva Temple were inscribed in 1986 on the UNESCO List of World Heritage Sites under Criterion III for its artistic creation and under Criterion V for the culture of the Chandelas that was popular till the country was invaded by Muslims in 1202
The Kandariya Mahadeva Temple, 31 metres in height, is in the western complex, which is the largest among the three groups of the Khajuraho complex of temples. This western group of temples, consisting of the Kandariya, Matangeshwara and Vishvanatha temples, is compared to a "cosmic design of a hexagon representing the three forms of Shiva. The temple architecture is an assemblage of porches and towers which terminates in a shikhara or spire, a feature which was common from the 10th century onwards in the temples of Central India.
The temple is founded on a massive plinth of 4 metres height. The temple structure above the plinth is dexterously planned and pleasingly detailed. The superstructure is built in a steep mountain shape or form, symbolic of Mount Meru which is said to be the mythical source of creation of the world. The superstructure has richly decorated roofs which rise in a grand form terminating in the shikara, which has 84 miniature spires. The temple is in layout of 6 square kilometres, of which 22 are extant including the Kandariya Mahādeva Temple. This temple is characteristically built over a plan of 31 metres in length and 20 metres in width with the main tower soaring to a height of 31 metres, and is called the "largest and grandest temple of Khajuraho". A series of steep steps with high rise lead from the ground level to the entrance to the temple.
The layout of the temple is a five-part design, a commonality with the Lakshmana and Vishvanatha temples in the Khajuraho complex. Right at the entrance there is torana, a very intricately carved garland which is sculpted from a single stone; such entrances are part of a Hindu wedding procession. The carvings on the entrance gate shows the "tactile quality of the stone and also the character of the symmetrical design" that is on view in the entire temple which has high relief carvings of the figurines. Finely chiseled, the decorative quality of the ornamentation with the sharp inscribed lines has "strong angular forms and brilliant dark-light patterns". The carvings are of circles, undulations giving off spirals or sprays, geometric patterns, masks of lions and other uniform designs which has created a pleasant picture that is unique to this temple, among all others in the complex.
In the interior space from the entrance there are three mandapas or halls, which successively rise in height and width, which is inclusive of a small chamber dedicated to Shiva, a chamber where Shiva's wife, Parvati is deified, and a central sanctum or garbhagriha where the Shiva linga, the phallic emblem of Shiva is deified. The sanctum sanctorum is surrounded by interlinked passages which also have side and front balconies. Due to inadequate natural light in the balconies the sanctum has very little light thus creating a "cave like atmosphere" which is in total contrast to the external parts of the temple. In the interior halls of the temple and on its exterior faces there are elaborately carved sculptures of gods and goddesses, musicians and apsaras or nymphs. The huge pillars of the halls have architectural features of the "vine or scroll motif". In the corners of the halls there are insets which are carved on the surface with incised patterns.
There is a main tower above the sanctum and there are two other towers above the other mantapas also in the shape of "semi-rounded, stepped, pyramidal form with progressively greater height". The main tower is encircled by a series of interlinked towers and spires of smaller size. These are in the form of a repeated subset of miniature spires that abut a central core which gives the temple an unevenly cut contour similar to the shape of a mountain range of mount Kailasa of the Himalayas where god Shiva resides, which is appropriate to the theme of the temples here.
The exterior surfaces of the temples are entirely covered with sculptures in three vertical layers. Here, there are horizontal ribbons carved with images, which shine bright in the sun light, providing rhythmic architectural features. Among the images of gods and heavenly beings, Agni, the god of fire is prominent. They are niches where erotic sculptures are fitted all round which are a major attraction among visitors. Some of these erotic sculptures are very finely carved and are in mithuna postures with maidens flanking the couple, which is a frequently noted motif.
There is also a "male figure suspended upside" in coitus posture, a kind of yogic pose, down on his head. The niches also have sculptures of Saptamatrikas, the septad of mother goddesses along with the gods Ganesha and Virabhadra. The seven fearful protector goddesses include: Brahmi seated on a swan of Brahma; Maheshwari with three eyes seated on Shiva's bull Nandi; Kumari; Vaishnavi mounted on Garuda; the boar-headed Varahi; the lion-headed Narasimhi and Chamunda, the slayer of demons Chanda and Munda