When Islam swept through Java in the 12th century, the kings of the Hindu Majapahit kingdom moved to Bali while the priest Nirartha established temples, including Rambut Siwi, Tanah Lot and Ulu Watu. In the 19th century, the Dutch formed alliances with local princes and eventually conquered the island. Westerners began celebrating Balinese arts in the 1930s; surfers arrived in the 1960s. As tourism has boomed, Bali's unique culture has proved to be remarkably resilient.

The First Balinese

There are few traces of Stone Age people in Bali, although it's certain that the island was populated very early in prehistoric times – fossilised humanoid remains from neighbouring Java have been dated to as early as 250,000 years ago. The earliest human artefacts found in Bali are stone tools and earthenware vessels dug up near Cekik in west Bali, which are estimated to be 3000 years old. Discoveries continue, and you can see exhibits of bones that are estimated to be 4000 years old at the Museum Manusia Purbakala Gilimanuk. Artefacts indicate that the Bronze Age began in Bali before 300 BC.

Little is known of Bali during the period when Indian traders brought Hinduism to the Indonesian archipelago, although it is thought it was embraced on the island by the 7th century AD. The earliest written records are inscriptions on a stone pillar near Sanur, dating from around the 9th century; by that time, Bali had already developed many similarities to the island you find today. Rice, for example, was grown with the help of a complex irrigation system, probably very like the one employed now, and the Balinese had already begun to develop their rich cultural and artistic traditions.

If little is known about the earliest inhabitants of Bali, then even less is known about Lombok until about the 17th century. Early inhabitants are thought to have been Sasaks from a region encompassing today's India and Myanmar (Burma) as opposed to migrating Balinese.

Hindu Influence

Java began to spread its influence into Bali during the reign of King Airlangga (1019–42), or perhaps even earlier. At the age of 16, when his uncle lost the throne, Airlangga fled into the forests of western Java. He gradually gained support, won back the kingdom once ruled by his uncle and went on to become one of Java's greatest kings. Airlangga's mother had moved to Bali and remarried shortly after his birth, so when he gained the throne, there was an immediate link between Java and Bali. It was at this time that the courtly Javanese language known as Kawi came into use among the royalty of Bali, and the rock-cut memorials seen at Gunung Kawi, near Tampaksiring, provide a clear architectural link between Bali and 11th-century Java.

After Airlangga's death, Bali remained semi-independent until Kertanagara became king of the Singasari dynasty in Java two centuries later. Kertanagara conquered Bali in 1284, but the period of his greatest power lasted a mere eight years, until he was murdered and his kingdom collapsed. However, the great Majapahit dynasty was founded by his son, Vijaya (Wijaya). With Java in turmoil, Bali regained its autonomy, and the Pejeng dynasty rose to great power. Temples and relics of this period can still be found in Pejeng, near Ubud.

Exit Pejeng

In 1343, the legendary Majapahit prime minister, Gajah Mada, defeated the Pejeng king Dalem Bedaulu, and Bali was brought back under Javanese influence.

Although Gajah Mada brought much of the Indonesian archipelago under Majapahit control, this was the furthest extent of their power. The 'capital' of the dynasty was moved to Gelgel, in Bali, near modern Semarapura, around the late 14th century, and this was the base for the 'king of Bali', the Dewa Agung, for the next two centuries. The Gelgel dynasty in Bali, under Dalem Batur Enggong, extended its power eastwards to the neighbouring island of Lombok and even westwards across the strait to Java.

The collapse of the Majapahit dynasty into weak, decadent petty kingdoms opened the door for the spread of Islam from the trading states of the north coast into the heartland of Java. As the Hindu states fell, many of the intelligentsia fled to Bali. Notable among these was the priest Nirartha, who is credited with introducing many of the complexities of Balinese religion to the island, as well as establishing the chain of 'sea temples', which includes Pura Luhur Ulu Watu and Pura Tanah Lot. Court-supported artisans, artists, dancers, musicians and actors also fled to Bali at this time and the island experienced an explosion of cultural activity that has not stopped to this day.

Feature: Artists in Charge

The lasting wholesale change to Balinese life because of the mass exodus of Hindu elite from Javanese kingdoms in the 16th century cannot be overstated. It's as if all the subscribers to the opera were put in charge of a town – suddenly there would be a lot more opera. The Balinese had already shown a bent for creativity but once the formerly Javanese intelligentsia exerted control, music, dance, art and more flowered like the lotus blossoms in village ponds. High status was accorded to villages with the most creative talent, a tradition that continues today.

This flair for the liberal arts found a perfect match in the Hinduism that took full hold then. The complex and rich legends of good and evil spirits found ample opportunity to flourish, such as the legend of Jero Gede Macaling, the evil spirit of Nusa Penida.

Dutch Dealings

In 1597, Dutch seamen were among the first Europeans to appear in Bali. Setting a tradition that has prevailed to the present day, they fell in love with the island and when Cornelius de Houtman, the ship's captain, prepared to set sail from the island, two of his crew refused to come with him. At that time, Balinese prosperity and artistic activity, at least among the royalty, was at a peak, and the king who befriended de Houtman had 200 wives and a chariot pulled by two white buffalo, not to mention a retinue of 50 dwarfs, whose bodies had been bent to resemble the handle of a kris (traditional dagger). By the early 1600s, the Dutch had established trade treaties with Javanese princes and controlled much of the spice trade, but they were interested in profit, not culture, and barely gave Bali a second glance.

In 1710, the 'capital' of the Gelgel kingdom was shifted to nearby Klungkung (now called Semarapura), but local discontent was growing; lesser rulers were breaking away, and the Dutch began to move in, using the old strategy of divide and conquer. In 1846, the Dutch used Balinese salvage claims over shipwrecks as a pretext to land military forces in northern Bali, bringing the kingdoms of Buleleng and Jembrana under their control. Their cause was also aided by the various Balinese princes who had gained ruling interests on Lombok and were distracted from matters at home, unaware that the wily Dutch would use Lombok against Bali.

In 1894, the Dutch, the Balinese and the people of Lombok collided in battles that would set the course of history for the next several decades.

With the north of Bali long under Dutch control and the conquest of Lombok successful, the south was never going to last long. Once again, it was disputes over the ransacking of wrecked ships that gave the Dutch an excuse to move in. In 1904, after a Chinese ship was wrecked off Sanur, Dutch demands that the rajah of Badung pay 3000 silver dollars in damages were rejected, and in 1906 Dutch warships appeared at Sanur.

Balil loses Lombok

In 1894, the Dutch sent an army to back the Sasak people of eastern Lombok in a rebellion against the Balinese rajah who controlled Lombok with the support of the western Sasak. The rajah quickly capitulated, but the Balinese crown prince decided to fight on.

The Dutch camp at the Mayura Water Palace was attacked late at night by a combined force of Balinese and western Sasak, forcing the Dutch to take shelter in a temple compound. The Balinese also attacked another Dutch camp further east at Mataram and soon the entire Dutch army on Lombok was forced back to Ampenan where, according to one eyewitness, the soldiers 'were so nervous that they fired madly if so much as a leaf fell off a tree'. These battles resulted in enormous losses of men and arms for the Dutch.

Although the Balinese had won the first battles, they had begun to lose the war. They faced a continuing threat from the eastern Sasak, while the Dutch were soon supported with reinforcements from Java.

The Dutch attacked Mataram a month later, fighting street-to-street against Balinese and western Sasak soldiers and civilians. Rather than surrender, Balinese men, women and children opted for the suicidal puputan (a warrior's fight to the death) and were cut down by rifle and artillery fire.

In late November 1894, the Dutch attacked Sasari and, again, a large number of Balinese chose the puputan. With the downfall of the dynasty, the local population abandoned its struggle against the Dutch.

Balinese Suicide

In 1906, the Dutch mounted a large invasion of Bali in order to subdue it once and for all. The Dutch forces landed despite Balinese opposition and, four days later, had marched 5km to the outskirts of Denpasar. On 20 September, the Dutch mounted a naval bombardment of Denpasar and began their final assault. The three princes of Badung realised that they were completely outnumbered and outgunned, and that defeat was inevitable. Surrender and exile, however, would have been the worst imaginable outcome, so they decided to take the honourable path of a suicidal puputan (a warrior's fight to the death). First the princes burned their palaces, and then, dressed in their finest jewellery and waving ceremonial golden kris, the rajah led the royalty, priests and courtiers out to face the modern weapons of the Dutch.

The Dutch implored the Balinese to surrender rather than make their hopeless stand, but their pleas went unheeded and wave after wave of the Balinese nobility marched forward to their death, or turned their kris on themselves. In all, nearly 4000 Balinese died. The Dutch then marched northwest towards Tabanan and took the rajah of Tabanan prisoner – he also committed suicide rather than face the disgrace of exile.

The kingdoms of Karangasem (the royal family still lives in the palaces of Amlapura) and Gianyar had already capitulated to the Dutch and were allowed to retain some of their powers, but other kingdoms were defeated and their rulers exiled. Finally, in 1908, the rajah of Semarapura followed the lead of Badung, and once more the Dutch faced a puputan. As had happened at Cakranegara on Lombok, the beautiful palace at Semarapura, Taman Kertha Gosa, was largely destroyed.

With this last obstacle disposed of, all of Bali was under Dutch control and became part of the Dutch East Indies. There was little development of an exploitative plantation economy in Bali, and the common people noticed little difference between Dutch rule and the rule of the rajahs.

The Tourist Class

Beginning in the 1920s, the Dutch government realised that Bali's unique culture could be marketed internationally to the growing tourism industry. Relying heavily on images that emphasised the topless habits of Bali's women, Dutch marketing drew wealthy Western adventurers, who landed in the north at today's Singaraja and were whisked about the island on rigid three-day itineraries that featured canned cultural shows at a government-run tourist hotel in Denpasar. Accounts from the time are ripe with imagery of supposedly culture-seeking Europeans who really just wanted to see a boob or two. Such desires were often thwarted by Balinese women who covered up when they heard the Dutch jalopies approaching.

But some intrepid travellers arrived independently, often at the behest of members of the small colony of Western artists, such as Walter Spies in Ubud. Two of these visitors were Robert Koke and Louise Garret, an American couple who had worked in Hollywood before landing in Bali in 1936 as part of a global adventure. Horrified at the stuffy strictures imposed by the Dutch tourism authorities, the pair built a couple of bungalows out of palm leaves and other local materials on the otherwise deserted beach at Kuta, which at that point was home to only a few impoverished fishing families.

Word soon spread, and the Kokes were booked solid. Guests came for days, stayed for weeks and told their friends. At first, the Dutch dismissed the Kokes' Kuta Beach Hotel as 'dirty native huts', but soon realised that increased numbers of tourists were good for everyone. Other Westerners built their own thatched hotels, complete with the bungalows that were to become a Balinese cliché in the decades ahead.

WWII wiped out both tourism and the hotels (the Kokes barely escaped ahead of the Japanese), but once people began travelling again after the war, Bali's inherent appeal made its popularity a foregone conclusion.

In 1987, Louise Koke's long-forgotten story of the Kuta Beach Hotel was published as Our Hotel in Bali, illustrated with her incisive sketches and her husband's photographs.

WWII

In 1942, the Japanese landed unopposed in Bali at Sanur (most Indonesians saw the Japanese, at first, as anticolonial liberators). The Japanese established headquarters in Denpasar and Singaraja, and their occupation became increasingly harsh for the Balinese. When the Japanese left in August 1945 after their defeat in WWII, the island was suffering from extreme poverty. The occupation had fostered several paramilitary, nationalist and anticolonial groups that were ready to fight the returning Dutch.

Independence

In August 1945, just days after the Japanese surrender, Sukarno, the most prominent member of the coterie of nationalist activists, proclaimed the nation's independence. It took four years to convince the Dutch that they were not going to get their great colony back. In a virtual repeat of the puputan nearly 50 years earlier, Balinese freedom fighters led by the charismatic Gusti Ngurah Rai (namesake of the Bali airport) were wiped out by the Dutch in the battle of Marga in west Bali on 20 November 1946. The Dutch finally recognised Indonesia's independence in 1949 – though Indonesians celebrate 17 August 1945 as their Independence Day.

At first, Bali, Lombok and the rest of Indonesia's eastern islands were grouped together in the unwieldy province of Nusa Tenggara. In 1958 the central government recognised this folly and created three new governmental regions from the one, with Bali getting its own and Lombok becoming part of Nusa Tenggara Barat.

Coup & Backlash

Independence was not an easy path for Indonesia to follow. When Sukarno assumed more direct control in 1959 after several violent rebellions, he proved to be as inept as a peacetime administrator as he was inspirational as a revolutionary leader. In the early 1960s, as Sukarno faltered, the army, communists and other groups struggled for supremacy. On 30 September 1965, an attempted coup – blamed on the Partai Komunis Indonesia (PKI; Communist Party) – led to Sukarno's downfall. General Suharto emerged as the leading figure in the armed forces, displaying great military and political skill in suppressing the coup. The PKI was outlawed and a wave of anticommunist massacres followed throughout Indonesia.

In Bali, the events had an added local significance as the main national political organisations, the Partai Nasional Indonesia (PNI; Nationalist Party) and the PKI, crystallised existing differences between traditionalists, who wanted to maintain the old caste system, and radicals, who saw the caste system as repressive and were urging land reform. After the failed coup, religious traditionalists in Bali led the witch-hunt for the 'godless communists'. Eventually, the military stepped in to control the anticommunist purge, but no one in Bali was untouched by the killings, estimated at between 50,000 and 100,000 out of a population of about two million, a percentage many times higher than on Java. Even as late as 2017, mass graves were still being discovered.

The 1963 Eruption

Amid the political turmoil, the most disastrous volcanic eruption in Bali in 100 years occurred in 1963. Gunung Agung blew its top in no uncertain manner, at a time of considerable prophetic and political importance.

Eka Dasa Rudra, the greatest of all Balinese sacrifices and an event that takes place only every 100 years on the Balinese calendar, was to culminate on 8 March 1963. It had been well over 100 Balinese years since the last Eka Dasa Rudra, but there was dispute among the priests as to the correct and most favourable date.

Naturally, Pura Besakih was a focal point for the festival, but Gunung Agung was acting strangely as final preparations were made in late February. Despite some qualms, political pressures forced the ceremonies forward, even as ominous rumblings continued.

On 17 March, Gunung Agung exploded. The catastrophic eruption killed more than 1000 people (some estimate 2000) and destroyed entire villages – 100,000 people lost their homes. Streams of lava and hot volcanic mud poured right down to the sea at several places, completely covering roads and isolating the eastern end of Bali for some time. Driving the main road near Tulamben you can still see some lava flows.

Suharto Comes & Goes

Following the failed coup in 1965 and its aftermath, Suharto established himself as president and took control of the government. Under his 'New Order' government, Indonesia looked to the West for its foreign and economic policies.

Politically, Suharto ensured that his political party, Golkar, with strong support from the army, became the dominant political force. Other political parties were banned or crippled. Regular elections maintained the appearance of a national democracy, but until 1999, Golkar won every election hands down. This period was also marked by great economic development in Bali and later on Lombok as social stability and maintenance of a favourable investment climate took precedence over democracy. Huge resorts – often with investors in government – appeared in Sanur, Kuta and Nusa Dua during this time.

In early 1997, the good times ended as Southeast Asia suffered a severe economic crisis, and within the year, the Indonesian currency (the rupiah) had all but collapsed and the economy was on the brink of bankruptcy.

Unable to cope with the escalating crisis, Suharto resigned in 1998, after 32 years in power. His protégé, Dr Bacharuddin Jusuf Habibie, became president. Though initially dismissed as a Suharto crony, he made the first notable steps towards opening the door to real democracy, such as freeing the press from government supervision.

Peace Shattered & Democracy Dawns

In 1999, Indonesia's parliament met to elect a new president. The frontrunner was Megawati Sukarnoputri, who was enormously popular in Bali, partly because of family connections (her paternal grandmother was Balinese) and partly because her party was essentially secular (the mostly Hindu Balinese are very concerned about any growth in Muslim fundamentalism). However, Abdurrahman Wahid, the moderate, intellectual head of Indonesia's largest Muslim organisation, emerged as president.

On Lombok, however, religious and political tensions spilled over in early 2000 when a sudden wave of attacks starting in Mataram burned Chinese and Christian businesses and homes across the island. The impact on tourism was immediate and severe, with some visitors also shunning Bali.

After 21 months of growing ethnic, religious and regional conflicts, parliament had enough ammunition to recall Wahid's mandate and hand the presidency to Megawati in 2001. In 2004 she was replaced by Indonesia's first democratically elected president, Susilo Bambang Yudhoyono (SBY). He had gained international recognition after he led the hunt for the 2002 Bali bombers.

The reign of SBY proved very successful. Indonesia's economy expanded at a rapid pace and he was easily re-elected in 2009 for another five-year term during which the nation (and Bali in particular) enjoyed rising fortunes and political calm. In 2014, Joko Widodo, the governor of Jakarta, won the presidency. Seen as a man of the people, he enjoyed widespread support. Although this included Bali – where he won the popular vote – there was some concern on the island that Jokowi (as he's known) was the first Indonesian leader in several generations to have no blood and/or marriage ties to Bali.

In recent years, visitors have been big news on Bali. As fears sparked by the bombings faded, international arrivals have increased by 10% to 15% a year on average. Where a short time ago two million visitors was a big deal, now that number hovers well above five million. Tourism is literally taking over many aspects of Balinese life, especially economic ones.

The Bali Bombings

On Saturday 12 October 2002, two bombs exploded on Kuta's bustling Jl Legian. The first blew out the front of Paddy's Bar. A few seconds later, a far more powerful bomb obliterated the Sari Club.

The number of dead, including those unaccounted for, exceeded 200, although the exact number will probably never be known. Many injured Balinese made their way back to their villages, where, for lack of adequate medical treatment, they died.

Indonesian authorities eventually laid the blame for the blasts on Jemaah Islamiah, an Islamic terrorist group. Dozens were arrested and many were sentenced to jail, including three who received the death penalty. But most received relatively light terms, including Abu Bakar Bashir, a radical cleric who many thought was behind the explosions. His convictions on charges relating to the bombings were overturned by the Indonesian supreme court in 2006, enraging many in Bali and Australia. (In 2011 he was sent back to prison for 15 years after a new conviction on terrorism charges.)

On 1 October 2005, three suicide bombers blew themselves up: one in a restaurant on Kuta Square and two more at beachfront cafes in Jimbaran. It was again the work of Jemaah Islamiah, and although documents found later stated that the attacks were targeted at tourists, 15 of the 20 who died were Balinese and Javanese employees of the places bombed.

Umar Patek was convicted in 2012 of helping to assemble the 2002 Bali bombs and sentenced to 20 years in jail. But threats continue: in 2012 police on Bali shot dead five suspected terrorists and there have been occasional arrests of suspected terrorists through 2018.