On the morning of 17 July 2009, the Dutch businessman Max Boon arrived at the J W Marriott in Jakarta for a monthly breakfast meeting organised by his consulting firm, Castle Asia. At 7.50am, as Boon and 17 other executives were sitting around a long dining table at the eastern end of the hotel, a man walked in and detonated a bomb strapped to his chest. Five minutes later, a second bomb exploded at the nearby Ritz Carlton. Nine people died and 52 were injured, including the young Dutchman, who had to have both of his legs amputated and suffered burns to 60 per cent of his body.
President Susilo Bambang Yudhoyono is said to have wept when, a month after the bombings, he received a letter from Boon, now in a wheelchair, congratulating him on independence day - 17 August. "He may have lost his legs," declared SBY (as the president is universally known), "but not his heart, spirit or mind." Jakarta newspapers later ran photographs on their front pages of Boon being embraced by Yudhoyono. "Indonesia is not a dangerous place to live," said the Dutchman, who announced his intention to stay on in the country and to marry his long-term Indonesian girlfriend.
The July 2009 attacks were not the first on symbols of western corporate power and affluence. The Marriott had been hit before, in 2003, as was the Australian embassy the following year, while bombs were set off on the tourist island of Bali in 2002 and 2005. Over 250 people died as a result of these attacks, all believed to have been orchestrated by Jemaah Islamiyah (JI), the south-east Asian terrorist group linked to al-Qaeda.
Despite being the fourth most populous country in the world, and the 16th-largest economy, Indonesia seldom features in the British media, except for the wrong reasons. Islamist terrorism. The massacre of Christians in East Timor. The western province of Aceh, on the island of Sumatra, making adultery punishable by stoning to death. Sharia courts handing down barbaric judgments, such as the one on a pregnant, married mother-of-two who was convicted of soliciting in 2006 - the evidence being that she had lipstick and face powder in her handbag as she waited for a bus home after work. The national parliament approving an anti-obscenity law that allows for sentences of up to ten years for "modelling" for pornography and four years for mere possession of pornographic material.
The impression is of a country teetering on the brink of extremism. The anxiety, expressed by the US senator Christopher Bond in his recent book The Next Front: South-East Asia and the Road to Global Peace With Islam, is this:
The region is home to one of the greatest concentrations of Muslims on earth . . . At 250 million, they outnumber the entire Muslim Middle East. The world's most populous Muslim-majority nation is Indonesia, 220 million [now 240 million], three times the largest Arab country, Egypt. But the Muslims of south-east Asia do not register in our mind's eye . . . Moderation is losing the high moral ground . . . Muslims we had considered moderate - or "mainstream" - began to take on the fundamentalist trappings of Arabs . . .
Bond concludes: "We can no longer afford this complacency and the ignorance it breeds." Yet, arriving at Soekarno-Hatta Airport, named after Indonesia's two greatest independence leaders (and retaining the old, Dutch spelling of Sukarno), visitors see little sign of religious affiliation of any kind. Far fewer women cover their head than in neighbouring Malaysia, where only 60 per cent of the population is Muslim, in contrast to Indonesia, with nearly 90 per cent. As you travel east into Jakarta, the city sprawls over a coastal plain of 255 square miles, from the docks in the north by the Java Sea down to the hills in the south. Mosques can be seen from the choked expressways, but the dominant architecture is of concrete, jostling for space with offices, malls and shiny new hotels.
Over coffee at the Pondok Indah Mall, Zuhairi Misrawi of Nahdlatul Ulama, the country's 30 million-strong Muslim organisation, advances a theory of startling moderation. "In NU we believe that the struggle for Indonesia is more meaningful than the struggle for Islam," he says, "because we love our country. It says in the Sunnah that to love your country is to believe in your God."
Zuhairi, who is 33 and trim in his crisp black and silver shirt, is not a member of the political party associated with NU, the National Awakening Party (PKB). Instead, in last year's elections, he stood for the secular, leftist Indonesian Democratic Party of Struggle (PDI-P), "to support the paradigm of nationalism through Islamic ideas".
It is hard to overstate the strength of nationalist feeling in Indonesia. This archipelago of 17,500 islands was united under the repressive rule of the Dutch, who established their first trading post on Java in 1603 but did not conquer the last parts of their East Indies colonies until the 20th century. While the British returned to Malaya and Borneo after the Second World War, the Dutch were not welcomed back in Indonesia. Two days after the Japanese surrender in 1945, Sukarno and Mohammad Hatta declared independence. The Netherlands' armies did not land until months later, and spent much of the following four years in a brutal attempt to reclaim their empire that outraged world opinion. During the chaos, various "independent" states were set up by the Dutch; both a Soviet republic and an Islamic state were briefly announced by other groups. Even after the Dutch finally departed and Sukarno declared a unitary state in 1950, the mainly Christian area of the South Moluccas proclaimed independence and rebellions broke out on the islands of Sumatra and Sulawesi.
Nationalism came to represent a "unity in diversity" - or bhinneka tunggal ika - that was as much an aspiration as an achievement for this multi-ethnic, multi-religious land. The words are the national motto, and are inscribed on the country's coat of arms. Two attempts to insert the Jakarta Charter - calling for sharia law to be made mandatory for all Muslims - into the constitution have failed, first in 1945, and again in 1998, during the transition to democracy after the fall of the Suharto dictatorship.
Faith has always been regarded differently here. "We are totally unlike Muslims in the Middle East and North Africa," Zuhairi tells me. "We even have to import our terrorists." He was referring to the JI leaders Azhari Husin and Noordin Top, both Malaysian, who were shot dead during police raids in 2005 and 2009.
Yet Middle Eastern fundamentalism has made inroads into Indonesian Islam, which is traditionally syncretic. "Before, many people were nominally Muslim, but really they were Hindu or animist," the PDI-P parliamentarian Budiman Sujatmiko says over dinner one evening at the Sultan Hotel, whose towers overlook the huge Gelora Bung Karno, the stadium in which President Obama was expected to have delivered a speech during a visit to Indonesia this year, twice postponed.
The language of fundamentalist Islam, whether being proposed by those who truly believe in it or by those merely using it for electoral advantage, is more widespread. "They are both the problem," Sujatmiko says. "Don't ask me which is better or worse."
The opportunists include the business-based Party of the Functional Groups - Golkar - which dominated the Suharto era. Elections were rigged in Golkar's favour, but the semblance of a vote allowed the dictatorship to claim the country was a democracy. Although its support has collapsed post-Suharto, it still won 14 per cent of the vote in the 2009 elections. Support for the key "fundamentalist" (that is to say, Islamist) Prosperous Justice Party (PKS) grew from 1.4 per cent in 1999 to 8 per cent last year.
For millennia, Hinduism, Buddhism and animism were the religions of the archipelago. Islam had arrived by the 13th century, but it never claimed all of the islands. Bali remains predominantly Hindu, while Christianity, brought first by the Portuguese and then by the Dutch, is widespread in the eastern isles. Even where Islam took hold, it overlay rather than obliterated pre-existing belief systems. President Suharto, who ruled from 1967-98, was a Muslim, but he also consulted a dukun, or soothsayer, and made much of his wife's royal lineage to draw on the mystical authority historically vested in Javanese rulers. One biographer referred to him as "Indonesia's last sultan".
Under Sukarno, who instituted "guided democracy" in 1957 (the last free elections before 1999 were held in 1955), and then Suharto, "the Indonesian state . . . was practically hostile to Islam", wrote Bahtiar Effendy, professor of political science at the State Islamic University, Jakarta. In consequence, Muslims adopted a "docile religious-political stance". The waves of radicalisation that swept through the Muslim world, first in reaction to the perceived failure of the pan-Arabist nationalist experiment in the 1970s and then, in the 1980s, after the Islamic Revolution in Iran, crashed into an impermeable obstacle in Suharto's authoritarian New Order (whose fervent anti-communism gained it such favour in the west that both the US and Australia backed his invasion of East Timor in 1975).
Although most of the population was Muslim, religion was expected to take second place to Pancasila, the five-pillared national ideology that includes belief in "one God" but deliberately does not specify which. Opposition of all kinds was firmly repressed, resulting in either banishment from the country, as in the case of the radical cleric Abu Bakar Ba'asyir (who later emerged as JI's spiritual leader), or internal exile, such as the thousands of suspected communists imprisoned on the penal island of Buru in the far east.
Then the unthinkable happened. The Suharto regime finally fell, brought down in the middle of the Asian economic crisis by demonstrations, riots, splits in the armed forces and an emboldened opposition. As the political sphere opened to all comers, a multiplicity of parties emerged: 181 between May and October 1998, 42 of which were specifically Islamic.
“We weren't prepared," says Zulkieflimansyah, chief economic strategist for the PKS. Zul and his progressive-minded allies, who want PKS to be inclusive and moderate, thought Suharto wouldn't step down until 2010. They weren't in place when the dictator fell, and the "seniors" who were - PKS has four cabinet ministers today - weren't so forward-thinking. "They were very influenced by the Muslim Brotherhood. So people said we were Taliban."
This impression was not helped by PKS's involvement in the passing of the very broadly defined anti-pornography law in October 2008, which was deemed a threat to the erotic dance cultures of Bali and Java and an attempt to impose Islamic values on the non-Muslim east. "Anything that supposedly raises the libido could be prosecutable," complained one protester at the time.
The Salihara arts complex, in the narrow, winding, low-rise streets of south Jakarta, is one place where the effects of the bill were feared - but never realised. Goenawan Mohamad, a renowned poet and founder-editor of Tempo magazine, says: "The trend to conservatism is unmistakable, more and more women wearing hijabs and so on. What's most worrying is the Islamic militants who might attack your theatre, or seize your books."
Tempo was twice closed down during the New Order. Goenawan's friends were jailed and one was kidnapped, never to be seen again. It must be unnerving to receive death threats. "The first time, yes," he says. "But after that, if I say something blasphemous, people go, 'He's not a famous Muslim intellectual, so what?'"
Goenawan, who is 69, mentions people's attachment to the Pancasila ideology and the strength it gives to those who oppose any attempt to curtail pluralism or free expression. It reaches back into a much older Javanese culture, which has always been very sensual. "It goes far deeper than Wahhabism," he says. "When we say 'unity in diversity', the Muslims can't say anything. We are an archipelagic culture. We have a lot of shores that have always been open to strangers."
Although Pancasila was used partly as an instrument of oppression under Suharto, it also exists to protect liberties.
The day I arrived in Jakarta, anti-government protesters paraded a buffalo named SiBuYa through the streets. The closeness to the president's initials, SBY, was not coincidental. "Under Suharto they would have been shot," Goenawan says.
Confidence may be widespread among Indonesians that their gentle tradition of Islam will endure. The outside world, however, worries. It is little more than a year since the bombs went off in Jakarta; today, hotels and shopping centres insist visitors pass through security scanners before entering. The early release of Abu Bakar Ba'asyir, jailed in 2005 in connection with JI terrorist attacks, infuriated Australia and the US. Detachment 88, the country's elite special force unit named in honour of the number of Australians who died in the first Bali bombings of 2002, has had great success in rounding up JI members. What was Indonesia doing releasing the group's spiritual leader so soon?
Goenawan says that criticism was mistaken. "It's good that he's out. Otherwise he would be a hero. Instead, he's a grumpy old man, a joke. Freedom helps. The Muslim Brotherhood flourished under Anwar al-Sadat because Egypt had no democracy. Only a small minority have ever voted for parties here that want an Islamic state. Democracy has the means to quell this."
Through pluralism and confidence in its own traditions, Indonesia, this nation state of 240 million people, offers a different model to the world of what it means to be a democratic, Muslim-majority country. There is unanimity that pursuing the goals of justice and alleviating poverty will ensure that the country's moderation is preserved.
The links with the Middle East will always persist, particularly through al-Azhar University in Cairo and the hajj to Mecca. Al-Azhar is generally considered the oldest university in the world and was historically the greatest centre of Sunni scholarship - so Muslims from Indonesia will always travel there to be educated in theology.
Indonesia has its own centres of Islamic scholarship and moderate networks of pesantren, or Muslim boarding schools. Saudis may fund mosques, it is argued, but the extremist ideology they hope to export along with the buildings fails to take root in a soil too rich and varied for dry, husky seeds from Arabia.
The US secretary of state, Hillary Clinton, for one, is optimistic. "As I travel around the world," she said during a visit to Jakarta in February last year, "I will be saying to people, if you want to know whether Islam, democracy, modernity and women's rights can coexist, go to Indonesia."
Zulkieflimansyah makes an even greater prediction. "If we can show that Islam and democratic values are compatible, we are confident the future of Islam can be written here in Indonesia," he says. "Otherwise there is no hope."
Sholto Byrnes is a contributing editor of the New Statesman.