The Prambanan temple is the largest Hindu temple of ancient Java, and the first building was completed in the mid-9th century. It was likely started by Rakai Pikatan and inaugurated by his successor King Lokapala. Some historians that adhere to dual dynasty theory suggest that the construction of Prambanan probably was meant as the Hindu Sanjaya dynasty's answer to the Buddhist Sailendra dynasty's Borobudur and Sewu temples nearby, and was meant to mark the return of the Hindu Sanjaya dynasty to power in Central Java after almost a century of Buddhist Sailendra dynasty domination. Nevertheless, the construction of this massive Hindu temple did signify a shift of the Mataram court's patronage, from Mahayana Buddhism to Shaivite Hinduism.
A temple was first built at the site around 850 CE by Rakai Pikatan and expanded extensively by King Lokapala and Balitung Maha Sambu the Sanjaya king of the Mataram Kingdom. A short red-paint script bearing the name "pikatan" was found on one of the finials on top of the balustrade of Shiva temple, which confirms that King Pikatan was responsible for the initiation of the temple construction.: 22
The temple complex is linked to the Shivagrha inscription of 856 CE, issued by King Lokapala, which described a Shiva temple compound that resembles Prambanan. According to this inscription the Shiva temple was inaugurated on 12 November 856.]: 20 According to this inscription, the temple was built to honor Lord Shiva, and its original name was Shiva-grha (the House of Shiva) or Shiva-laya (the Realm of Shiva).
According to the Shivagrha inscription, a public water project to change the course of a river near Shivagrha temple was undertaken during the construction of the temple. The river, identified as the Opak River, now runs north to south on the western side of the Prambanan temple compound. Historians suggest that originally the river was curved further to east and was deemed too near to the main temple. Experts suggest that the shift of the river was meant to secure the temple complex from the overflowing of lahar volcanic materials from Merapi volcano. The project was done by cutting the river along a north to south axis along the outer wall of the Shivagrha Temple compound. The former river course was filled in and made level to create a wider space for the temple expansion, the space for rows of pervara (ancillary) temples.
The statue of Shiva Mahadeva inside the garbagriha of the main temple.
Some archaeologists propose that the statue of Shiva in the garbhagriha (central chamber) of the main temple was modelled after King Balitung, serving as a depiction of his deified self after death.[8] The temple compound was expanded by successive Mataram kings, such as Daksa and Tulodong, with the addition of hundreds of pervara temples around the chief temple.
With main prasada tower soaring up to 47 metres high, a vast walled temple complex consists of 240 structures, Shivagrha Trimurti temple was the tallest and the grandest of its time.[1] Indeed, the temple complex is the largest Hindu temple in ancient Java, with no other Javanese temples ever surpassed its scale. Prambanan served as the royal temple of the Kingdom of Mataram, with most of the state's religious ceremonies and sacrifices being conducted there. At the height of the kingdom, scholars estimate that hundreds of brahmins with their disciples lived within the outer wall of the temple compound. The urban center and the court of Mataram were located nearby, somewhere in the Prambanan Plain.