Sign In

Sailendra and Sanjaya: The Kingdoms That Built the Temples

Sailendra and Sanjaya in Central Java: the kingdoms behind the temples

The Sailendra and Sanjaya names belong to Central Java’s political and religious history in the eighth and ninth centuries, the age of the Mataram kingdom, also called Medang. Borobudur and other Buddhist monuments belong to the Sailendra era; the Sanjaya name is tied to Shiva worship and later to Prambanan’s Hindu temples. They are often shown as two royal lines, one Shaiva Hindu and one Mahayana Buddhist, whose rulers sponsored great monuments on the Kedu and Prambanan plains. A useful first map, but a rough guide, not a family tree.

Knowing the story changes how the monuments read. It explains why Central Java has great Hindu and Buddhist monuments within a short drive of each other, and why the rulers behind them are spoken of with care. For the monuments themselves and how to see them, start with the Central Java travel guide and its destination routes.

Two names, two ways of reading them

“Sanjaya dynasty” and “Sailendra dynasty” are convenient labels, but they do not divide Central Java neatly into two enduring royal houses. Sanjaya appears in a Shaiva inscription of 732, and a king list issued nearly two centuries later begins with his name. The Sailendra name appears in a different group of inscriptions connected with Buddhist foundations and the rulers who sponsored them.

One reading has two dynasties sharing Central Java at the same time: a Shaiva Sanjaya line and a Buddhist Sailendra line, sometimes cooperating, sometimes competing, and eventually joined by marriage. In that telling, Prambanan was the Hindu answer to Borobudur, built when the Sanjaya line returned to power. The other reading holds that Sailendra and Sanjaya were one ruling family, and that the religion favoured at court simply followed the faith of whichever ruler was on the throne. Both readings keep the same monuments and the same rulers; they differ on how those rulers were related.

The clearest way to hold the history is to keep three things apart: what a particular inscription says, how the ruling families fit together, and which monuments belong to which reign. Each is a separate question, and the answer to one does not settle the others.

Canggal and the first appearance of Sanjaya

The Canggal inscription, dated 732, is the starting point for the Sanjaya story. It records that Sanjaya had a lingga, the symbol of Shiva, set up on a hill as a place of worship. It also names an earlier king, Sanna, whose rule came before Sanjaya’s. The stone ties Sanjaya firmly to Shaiva worship and to a royal act expressed through a sacred installation.

That is more precise than saying that Sanjaya “built the Hindu temples of Java”. The inscription names one ruler, one religious symbol and one act of foundation. It does not by itself cover every later king or every monument, and broad labels can make early Central Java look more uniform than it was.

The Mantyasih inscription of 907, issued under King Balitung, explains why Sanjaya became the name for a dynasty. It sets out a list of earlier kings of Mataram and places Sanjaya at its head. Read together, the two stones give a line of rulers that can be followed, though a king list is a statement of royal succession rather than a full family history.

For a visitor comparing monuments, the Sanjaya name is most useful as a pointer to one strand of royal and Shaiva history. The great temple complex at Prambanan belongs to that strand, but the many temples of the region were built and enlarged over generations, and no single named line accounts for all of them.

Kalasan and the Sailendra patronage of Buddhism

The Sailendra name is closely linked to Mahayana Buddhism in Central Java. The best-known early record is the Kalasan inscription of 778. It tells how the spiritual teachers of the Sailendra house urged a ruler, Maharaja Tejapurnama Panangkaran, known as Rakai Panangkaran, to build a shrine to the goddess Tara and a monastery for Buddhist monks. Candi Kalasan, in the Yogyakarta region, is the shrine that stands on the site today.

The Kalasan story is central to the whole question of the two names. Panangkaran is described as a son of Sanjaya, yet he sponsors a Buddhist foundation at the urging of Sailendra teachers. Seen one way, a Sanjaya king was supporting a Sailendra religious project; seen another, the Buddhist turn shows a single royal family changing its religious allegiance. Either way, the link between royal authority and Buddhist patronage is plain to see in the temple itself.

Other early inscriptions, such as the one found at Sojomerto, are also part of the long discussion about the origins of the Sailendra name. Together they show that Buddhist patronage in Central Java involved many foundations over many decades, not a single isolated act.

Borobudur and Prambanan show different forms of patronage

Borobudur is the monument most visitors connect with the Sailendra era. It is a vast Buddhist monument in Magelang, with a designed progression up through terraces lined with carved reliefs. Its scale makes royal and religious investment legible even before a visitor knows anything about the kings behind it. Like most large monuments of the period, it was built in stages rather than at a single moment.

Prambanan offers a different but complementary view. The great Hindu complex is dedicated to the Trimurti of Brahma, Vishnu and Shiva. The central temple, about 47 metres high, belongs to Shiva and is the largest building in the complex, with the Brahma temple to its south and the Vishnu temple to its north. Its construction is usually credited to Rakai Pikatan, and later kings completed and extended it.

Seeing the monuments as a pair is useful, but it is better not to read them as a clean handover from Buddhist Sailendra to Hindu Sanjaya rule. In the two-dynasty reading, Prambanan was a deliberate artistic, political and religious answer to Borobudur; in the one-family reading, the change reflects the faith of the reigning king. Shared political space, royal marriages, patronage and competition can all coexist, and the monuments reflect religious life and organised resources rather than a dynasty chart.

For the landscape and its temple groups around Borobudur, read the Magelang and Borobudur guide, and for a living link with the Buddhist side of the story, see the page on the Bodhi Tree in Indonesia.

Marriage and succession join the two strands

Rakai Pikatan and Pramodawardhani stand at the point where the two strands meet. Pramodawardhani was the daughter of the Sailendra king Samaratungga; Pikatan belonged to the Sanjaya line and to Shaiva royal power. Their marriage is the clearest sign of a union between the two houses, and Pikatan’s reign is the period in which Prambanan was begun. The reign of Rakai Pikatan is the turning point of the whole story.

Balaputra, a son of Samaratungga and so a brother of Pramodawardhani, is the other key figure. He lost a struggle for power in Java to Pikatan and withdrew to Srivijaya in Sumatra, where he became ruler and kept the Sailendra name alive outside Java. A short statement such as “the Sailendras were expelled” compresses several steps into one line: a family dispute, a contest for the throne and the continuation of the Sailendra claim on another island.

These figures are best understood as the hinges of the story. Royal marriage may have created a shared line, different branches may have competed, or later rulers may have reshaped their claims to the throne. Any of these can sit behind the same set of names.

How stone inscriptions shape the story

The stone inscriptions of this period are among its most important survivals because they preserve names, dates, religious language and details of royal action. A foundation inscription might praise a ruler and explain a gift; a king list might set out succession. Each gives a particular angle, so they are best compared rather than read as if one covered the whole region.

Dates need the same care. A dated inscription gives a firm point, but it does not date every stage of a monument or the beginning of a dynasty. The resulting chronology can be strong without matching a single construction date for a whole temple.

Names and titles add another layer. A ruler may appear with a personal name, a title or a form of address that changes from one stone to another, and a later list can keep a name while leaving out the details needed to trace kinship. That is why the same inscriptions can support more than one picture of how the royal houses fit together.

Religious labels also have limits. Sanjaya’s Canggal inscription is Shaiva, while the Sailendra-linked foundations are Buddhist. That does not mean each family practised only one tradition, or that the region was split into religious blocs. The foundations show royal support for particular institutions rather than the beliefs of the whole population.

What a visitor can take away

If you visit Borobudur or Prambanan, the Sanjaya–Sailendra story gives you a more grounded way to read the landscape. Look for the difference between a monument’s religious form and the royal story attached to its patronage. A Buddhist structure can be understood through royal grants without assuming that every ruler of the period belonged to a separate Buddhist dynasty, and a Hindu complex can be connected with Shaiva kingship without reducing every ruler to one religious identity.

The history is not confined to a single temple or a single capital. The inscriptions and monuments belong to a wider landscape of settlements, religious foundations and royal centres spread across Central Java and the neighbouring territory of Yogyakarta, where Prambanan and Kalasan stand. The kingdom of Medang, the name under which this Mataram state is often known, ties the whole period together.

Frequently asked questions

Were Sanjaya and Sailendra two separate dynasties?

That is one common reading, though not the only one. One view has two royal houses sharing Central Java; the other sees a single ruling family whose religion followed the reigning king. The rulers and their foundations are the same in both views; what differs is how they were related.

Did the Sailendras build Borobudur?

Borobudur was built during the Sailendra era as a great Buddhist monument, and it is closely associated with Sailendra patronage. Like other large monuments of the period, it rose in stages over many years.

Does Prambanan show that Hindu rulers replaced Buddhist rulers?

Not simply. Prambanan is a major Hindu temple complex begun under Rakai Pikatan, who had married into the Sailendra house, while Borobudur is a major Buddhist monument. Their coexistence points to a history of royal patronage, marriage and changing authority rather than a single religious takeover.

Who was Balaputra?

Balaputra was a son of the Sailendra king Samaratungga. After losing a struggle for power in Java to Rakai Pikatan, he went to Srivijaya in Sumatra and became its ruler.

For the wider sweep of the region’s past, read Central Java History and Legends: Kingdoms, Stones and Folktales.

Back to top