Members of the Ahmadiyah pray before the biers bearing the bodies of fellow members, killed by a Muslim mob. Photograph: Nurani Nuutong/AFP/Getty Images

The first week of February marked the annual celebration of World Interfaith Harmony Week, a UN resolution that aimed to promote religious and cultural understanding among people of different faiths. But proceedings were marred by the cruellest of events in Indonesia, with celebrations tarnished by a string of vicious attacks on the nation's religious minorities.

The most serious attack was waged against the Ahmadiyah sect in Banten, which resulted in three of its members being beaten to death at the hands of the Islamic Defenders Front, a hardline Islamic group. The history between the two has been fractious at best, but in recent times the conflict has assumed an internecine edge. Footage of the bloody attack in Banten on 6 February showed police officers providing an embarrassingly feeble match for a crowd of 1,500 villagers, equipped with machetes, rocks and bamboo sticks.

Ahmadiyah Muslims believe Mirza Ghulam Ahmad was Islam's last prophet, and as such find themselves at odds with the Islamic Defenders Front, which has repeatedly called upon local and provincial authorities to disband the sect, in addition to vandalising mosques and physically harassing members. The group even receives tacit encouragement from members of the Indonesian government, such as the federal religious affairs minister, who proposed that Ahmadiyah followers renounce their identification with Islam and refrain from using Islamic symbols.

Indonesia has undergone a remarkable transition after decades of repression under the Suharto regime. It can now claim a thriving democracy, a burgeoning civil society and record levels of economic growth to its name. It is touted as a bastion of a more moderate, democratic Islam; it has staked its nationhood on a mantra of "unity in diversity". But Indonesia remains plagued by vast economic inequalities, disenfranchised youth and porous borders: elements conducive to encouraging radicalism. Lately, there have been an increasing number of attacks on religious freedom spearheaded by hardline Islamic groups, who see themselves as the sole vanguard of morality amid the nation's anxious lurch towards modernity.

As religious hate crimes blemish the archipelago's moderate and tolerant image, the government faces pressure from human rights groups and disgruntled citizens to enshrine religious pluralism in law. International groups, such as Amnesty International, have declared that religious freedom in Indonesia is "in tatters", while peace rallies have been staged across the nation, urging the government to protect the right to religious freedom. And still, President Susilo Bambang Yudhoyono has been keen to trumpet Indonesia as a poster-child for unity amid diversity, emboldening a once-fractured nation by its embrace of religious, cultural and ethnic pluralism.

But in the aftermath of all the violence, his remarks ring hollow. While Yudhoyono has condemned the actions of those responsible for the killings in Banten, he also implored the Ahmadiyah community to "respect the joint [ministerial] agreement signed in 2008", which refers to a decree banning the sect from public worship and disseminating its beliefs. This decree, coupled with the decision of the Indonesian constitutional court to uphold a controversial law banning religious blasphemy, shows that religious pluralism in Indonesia is far from fully realised. Instead, it reveals that institutional sclerosis systemically undermines the very values that are an intrinsic part of Indonesia's national identity.

While these incidences of religious persecution may be specific to Indonesia, their implications are universal. Its struggles for democracy and pluralism are now being fought by other Muslim-majority nations such as Egypt and Tunisia. Clearly, the Indonesian narrative has much to teach the rest of the world: it challenges the misconception that moderate Islam and democracy are incompatible, and also shows that Muslim-majority nations are willing to embrace a more secular brand of nationalism. Of Indonesia's 250 million inhabitants, 86% are Muslims, yet presidents from secular political parties have repeatedly been elected to office.

Of course, Indonesia's transformation also highlights some inconvenient truths: that the road to progress is a rocky one, and that clashes between competing ideologies are inevitable. Nonetheless, it is how one resolves these clashes that is of greater significance. If the Indonesian government is serious about maintaining Indonesia's reputation as a bulwark of pluralism, democracy and moderate Islam, it must realise that its actions will speak much louder than its rhetoric.