A feverish atmosphere now grips Malaysia. The country is awash with rumours. Until the resignation in 2003 of the previous prime minister, Dr Mahathir Mohamad - after 22 years in office - its politics was entirely predictable. Now it is becoming highly unpredictable.

Malaysia is one of the great Asian success stories. It has enjoyed a growth rate of up to 8% for much of the past 20 years, and the fruits of prosperity are everywhere to be seen, from the magnificent twin towers in Kuala Lumpur to the expressways and traffic congestion. Without doubt Malaysia is the great economic star of the Muslim world. The architect of this economic transformation was Dr Mahathir, but since he stepped down the country has been engulfed by growing doubts about his legacy and the emergence of a new set of priorities.

The turning point was the general election last March. Ever since the country gained independence from Britain in 1957 it has been ruled by the Barisan Nasional, a coalition of three racially based parties led by the United Malays National Organisation (Umno), which has dominated Malaysian politics, leaving the opposition permanently enfeebled and embattled. In March, however, the government gained only 51% of the popular vote compared with 64% at the last election in 2004.

It was its worst performance ever, and was compounded by the fact that the BN lost its two-thirds majority in parliament, by virtue of which it had previously been able to enact constitutional change. The government still enjoys a healthy majority, but the election has undermined its self-confidence, hugely enhanced that of the opposition and transformed the mood of the nation; where once politics seemed set in stone, suddenly change is in the air.

The government has become defensive and fearful, symbolised by the prime minister Abdullah Badawi, who is a weak leader in comparison with his formidable and long-serving predecessor. The government's defensiveness is illustrated by its latest legal assault against Anwar Ibrahim, the leader of the opposition coalition and a former deputy prime minister.

In 1998 he was charged with sodomy (engaging in a homosexual act, which is illegal in Malaysia) and imprisoned for 15 years, but released in 2004 after the appeal court overthrew his conviction. Fearful of his imminent return to full-scale politics after serving a period of disqualification, the government has once again charged him with sodomy ("carnal intercourse against the order of nature"). In a recent poll, two-thirds believed the charges were politically motivated. Indeed, a remarkably apologetic leader in the Umno-run New Straits Times last Saturday displayed a transparent lack of conviction in the charges. In a predominantly Muslim country, the sodomy charge is manifestly designed to discredit Anwar in the eyes of Malays, while the timing is a blatant attempt to prevent him from returning to parliament. In short, it is the unimaginative act of a government that is running scared.

The government, meanwhile, finds itself mired in another scandal - the murder of a young Mongolian translator in 2006, for which a close political adviser of Najib Tun Razak, the ambitious deputy prime minister and defence minister, is standing trial, together with two of his bodyguards. The fact that, subsequent to her murder, an attempt was made to remove all traces of her body by the use of special explosives, whose use can only be sanctioned by the highest authorities in the government, has encouraged widespread speculation that Najib and his wife were involved in the murder - which appears to have been related to a lucrative submarine deal with France.

The government has only itself to blame for this endemic mood of rumour. The media is closely controlled by the government and is widely disbelieved. As a result the vacuum of information and opinion has been filled by two websites - malaysiakini.com and malaysia-today.net - which have become highly influential, outspoken and merciless towards a government that no longer controls the information agenda in the way that it has previously, further serving to undermine its position.

The growing lack of confidence in the government is fuelled by systemic corruption, especially in Umno, and a widely held view that the benefits of the country's economic growth have not been shared equitably, with poorer Malays and the Indian minority in particular losing out badly. Indeed it was a demonstration by the Indian minority-rights organisation Hindraf last year that helped to draw the nation's attention to the plight of the Indian community and the neglect of the poor. Corruption is rife in Umno, which has become a vehicle for personal enrichment; its vice-president said last week that "it has become rampant at all levels and it is frightening if this becomes normal practice in future".

Events could move quickly. On August 26 Anwar will stand as the opposition Pakatan Rakyat candidate in his old parliamentary constituency and will undoubtedly win by a huge margin. The government, meanwhile, will attempt to stymie his rise by the use of the sodomy case. Anwar has regularly predicted that the government will fall by September 16 when, he claims, about 30 government defections will enable the opposition to form a new government.

It is unlikely to be so simple. The old order, which has ruled Malaysia for 51 years, will mount a desperate fight to ensure its own survival. Too many people have got too much to lose; a Pakatan government would threaten their reputations, careers, wealth and, in some cases perhaps, freedom. A further problem concerns the nature of the opposition. A Pakatan government would be a combination of incongruous, incoherent and uneasy bedfellows: the Islamic PAS, DAP (a predominantly Chinese party) and Anwar's Keadilan. As a consequence, the opposition's credibility as an alternative government is seriously flawed.

The greatest fear must be that as the old order weakens, underlying racial tensions will be exacerbated and exploited for nefarious purposes. Malaysia is multiracial in a way true of few societies outside Africa: with Malays accounting for around 60% of the population, the Chinese for some 25% and Indians 8%, this is a country that depends on a racial consensus for its stability. That cannot be said of any European society, Britain included.

Such racially diverse societies are extremely difficult to govern, and it is to Malaysia's enormous credit that it has combined economic growth with relative racial harmony - a feat for which it has rarely been given the credit it deserves in the west. Undoubtedly the present system of positive discrimination in favour of Malays has largely outlived its usefulness, but any reforms will be difficult and potentially fraught. Hopefully the kind of political change that Malaysia now requires can, in time, be achieved without losing its most precious achievement. But there can be no guarantees.

· Martin Jacques is a visiting research fellow at the London School of Economics Asia research centre



martinjacques1@aol.com

· This article was amended on Friday August 15 2008. We referred to the website 'malaysiatoday.com' in the above article. This should have been malaysia-today.net. This has been corrected.