In the 8th Century, a Buddhist priest called Rsi Marhandya came to Bali from Java on pilgrimage with a group of followers. He meditated where the East and West Wos Rivers meet in Campuan, on the edge of Ubud, and declared the place holy. Accordingly, a shrine was built, and later expanded by Nirartha, the Javanese priest who is regarded as the father of Bali ‘s religious institutions and practices. This temple is now known as Pura Gunung Lebah or Pura Campuan.
With the spread of Hindu-Buddhist culture in Bali in the 10th to 12th Centuries, Shivaite holymen established hermitages and teaching monasteries near Ubud, at the bequest of local rulers. The temple-memorial complex at Gunung Kawi and the cave temples at Goa Gajah (east and northeast of Ubud) are undoubtedly the most impressive architectural remains from this period. By this time, the people of the Ubud area already practiced sophisticated wet rice farming, kept a variety of livestock and employed techniques of stone and woodcarving, metalworking and thatching that are still very much alive. Many of the dances, drama, puppet plays and elaborate rituals and superstitions that animate Ubud culture today originated in these early kingdoms nearby.
The Balinese legend of Rangda the witch originated in the Ubud area at this time, when the half-Balinese King Airlangga ruled Java and Bali , with its capital located then in Batuan, southeast of Ubud. The Barong and Calinarong dances which visitors still enjoy derived from the story of Airlangga’s struggle against the plagues and evil spells cast by Rangda, who is purportedly buried in a tomb near Kutri, southeast of Ubud.
Airlangga’s sons divided his empire, and Bali was ruled by Anak Wungsu, who established a flourishing kingdom between the Petanu and Pakerisan Rivers , east of Ubud.
The Javanese Majapahit dynasty “conquered’ Bali in 1343, when its military forces by the great hero, Gajah Mada subjugated the Pejeng Dynasty, based in Bedulu, just east of Ubud. According to Majapahit reports, the “vile, long-haired Balinese princes were wiped out,” and more refined models of Javanese culture were adopted. Indeed, a great flowering of Balinese culture took place under the Majapahit rulers, who were chosen from the military leaders of the Javanese incursion. Balinese genealogies, the babad, written at this time, document the Majapahit ancestry of Bali ‘s aristocratic families, who still inhabit the palaces of Ubud.
Facing the “Islamisation” of Java and the subsequent decline of the Majapahit Empire in the 16th Century, many scholars, dancers, craftsmen, intellectuals and priest migrated to Bali , bringing along their skills and sacred texts. Many settled in the small kingdoms in and around ubud, among them Nirartha, the “super-priest” who is regarded as the progenitor of all of Bali ‘s pedanda Siwa high priests and their prominent Brahmana families. The seat of the Majapahit overlord of Bali was moved from Samprangan near Gianyar, to Gelgel, and Bali entered cultural “Golden Age” under the Gelgel kings.
When Gelgel fell, and its remnants regrouped in Klungkung, secondary kingdoms arose throughout the island and engaged in ongoing power struggles. In the early 18th Century, a palace was established in Timbul, south of Ubud, by a descendant of the Gelgel line. His ambition to create a dream kingdom, based on the ideal of Majapahit Java was more of less fulfilled, as he drew to his court the finest musicians, dancers, carvers and artisans, and built a splendid palace filled with lavish garden. As the story goes, his cultural accomplishments were so great that upon witnessing them, people could not help but exclaim, “My heart’s delight!” In Balinese, “sukahatine.” The word evolved into “Sukawati,” which is now the name of this visionary king’s line of descendants, and the town where he built his palace.
Throughout the 18th Century, control of the areas around Ubud and Gianyar passed back and forth between the Sukawati Dynasty whose princes are called “Tjokordas” and the Gianyar Dynasty, with its “Anak Agungs” and “Dewas”. Ultimately, the region became a patchwork of small dominions ruled by Princes from one faction or the other, or the scion of intermarriage between them. This is still the case, and while Ubud’s palaces house a core line of the Sukawati family, other palaces in the region belong to Gelgel Gianyar stock or a separate royal line from Blahbatuh.
During the 19th Century, Ubud became an important court under its Sukawati feudal lord, owing allegiance to Gianyar. In 1884 Gianyar was overthrown by Sukawati princes from the nearby town of Negara , and after ten years of conflict, a Sukawati from the palace in Ubud sided with Gianyar and cooled the conflict. Perhaps the experience of centuries of adept politicking between these two dynasties gave them both the ability to understand the value of diplomacy and compromise when the Dutch asserted their power in Bali .