After the empire fell to its Muslim vassal the Demak Sultanate, a number of Hindu Majapahit courtiers, nobles, priests, and artisans found refuge on the island of Bali.
As a result, Bali became what historian Ramesh Chandra Majumdar describes as the last stronghold of Indo-Javanese culture and civilisation.
Since the mid-19th century, the colonial state of the Dutch East Indies began its involvement in Bali, as it launched its campaign against the Balinese minor kingdoms one by one.
However, the ancestors of the current Balinese inhabitants reached the island around 3,000 to 600 BCE during the Neolithic period, characterised by rice-growing technology and speaking Austronesian languages.
The historical period in Bali started in c. 8th century, marked by the discovery of inscribed Buddhist votive clay tablets.
These Buddhist votive tablets, found in small clay stupa figurines called "stupikas", are the first known written inscriptions in Bali and date from around the 8th century CE.
In the early 10th century, a king called Sri Kesari Warmadewa issued the Belanjong pillar inscription found near the southern strip of Sanur Beach.
In the second half of the 10th century, Bali was ruled by King Udayana Warmadewa and his queen, Mahendradatta, a princess of the Isyana dynasty from East Java.
After the Warmadewa dynasty, their descendant, and their link to the Javanese court, there is no continuous further detailed information found about the rulers of Bali.
According to the Javanese chronicle Deśavarṇana: "In Śaka 'bodies-sky-suns' (1206, AD 1284) he then sent emissaries to Bali to crush it, and before long its queen was overcome and duly brought as captive before the King" (42.1).
Arya Kenceng led his brothers to govern Bali under Majapahit banner, he would become the ancestor of Balinese kings of Tabanan and Badung royal houses.
Following Hayam Wuruk's death in 1389, Majapahit entered a steady period of decline with conflict over succession, among other was Regreg war (1404 to 1406).
To keep Majapahit influence and economic interest, Kertabhumi awarded Muslim merchant trading rights on the north coast of Java, an action which led to the prominence of Demak Sultanate in following decades.
This policy increased Majapahit economy and influence, but weaken Hindu - Buddha's position as the main religion, as Islam began to spread faster and freely in Java.
In 1478, Ranawijaya's army under general Udara breached Trowulan defences and killed Kertabumi in his palace,[9][10] Demak sent reinforcements under Sunan Ngudung, who later died in battle and was replaced by Sunan Kudus, but they came too late to save Kertabumi although they managed to repel the Ranawijaya's army.
This event is mentioned in Jiwu and Petak inscription, where Ranawijaya claimed that he already defeated Kertabhumi and reunited Majapahit as one Kingdom.
The whole court of Majapahit fled to Bali following the conquest by the Muslim rulers in 1478, in effect resulting in the transfer of the whole culture.
Bali was looked on as the continuation of the Hindu Javanese culture and is the major source of knowledge about it in the modern times.
The marriage of prominent Balinese families along with Majapahit royalty led to the foundation of upper caste lineages of Bali.
As a result of the influx of the Javanese element, historian Ramesh Chandra Majumdar states that Bali "soon became the last stronghold of Indo-Javanese culture and civilisation.
"[16] According to the Babad Dalem manuscript (composed in 18th century), the conquest of Bali by the Hindu Javanese kingdom of Majapahit was followed by the installation of a vassal dynasty in Samprangan in the present-day Gianyar regency, close to the old royal centre Bedulu.
[18] In Majapahit, East Java, the fall of Daha to Demak Sultanate in 1527 has prompted the refuge of Hindu nobles, priests and artisans to Bali.
Gelgel's influence over the still Hindu Blambangan seems to caught the attention the Sultan of Mataram that aspired to unite the whole of Java and also to spread Islamic faith.
The island was in fact split into nine minor kingdoms; Klungkung, Buleleng, Karangasem, Mengwi, Badung, Tabanan, Gianyar, Bangli and Jembrana.
These minor kingdoms developed their own dynasty, built their own Puri (Balinese palace compound) and established their own government.
In following centuries, the various kingdoms fought a succession of incessant wars among themselves, although they accorded the Dewa Agung a symbolic paramount status of Bali.
During the Dutch East Indies period, the colonial capital of Bali and Lesser Sunda Islands was located in Singaraja on the northern coast.