Last week a Tibetan mastiff was flown into Xian airport in central China, where it received a welcome fit for an emperor.

The dog was swept into town by a convoy of 30 Mercedes-Benz cars. Tibetan mastiffs are a rare and noble breed – and the pampered pooch had cost his new owners Rmb4m ($586,000, €402,000, £351,000). Reporting the story, the China Daily newspaper commented nervously that such an extravagant display of wealth might “heighten tension between rich and poor”.

This shaggy dog story is just a particularly weird example of the new wealth of modern China. When I last visited the Pudong district of Shanghai, in the mid-1990s, it was a ramshackle area of factories and warehouses. Last week, I found it transformed into a forest of neon-lit, modernist skyscrapers. China has shrugged off the global recession and should grow by 8 per cent in 2009.

This year the country has passed a number of economic milestones. It is now the world’s largest exporter, surpassing Germany. It is the world’s largest market for vehicles, surpassing America. Its foreign reserves, the world’s largest, are now over $2,000bn. The biggest landmark of them all – the moment when China becomes the world’s largest economy – is getting closer. Goldman Sachs famously predicted a couple of years ago that China would hit that target in 2027. But that was before the financial crisis. If America is now set for a long period of slower growth, the big moment could come rather sooner.

Back in 1979, Ezra Vogel, an American academic, wrote a book with the title Japan as Number One. Now China is getting the same sort of attention. Martin Jacques, a British writer, has caused a stir with his new book, boldly titled When China Rules the World.

The psychology of the relationship between the US and China has shifted already. As a presidential candidate in 2007, Hillary Clinton asked herself the rhetorical question “Why can’t we get tough on China?” and answered: “How do you get tough on your banker?” Since then the financial crisis has hugely expanded the US budget deficit and made America even more reliant on Chinese purchases of US debt. China is currently thought to be buying at least $20bn worth of US Treasury bills a month.

In the year since the financial crisis broke, the Chinese government has become noticeably more assertive in the way it talks to America. Wen Jiabao, the country’s prime minister, has called on the US to “maintain its credibility, honour its commitments and guarantee the safety of Chinese assets”. China’s central bank has speculated publicly about whether the dollar should be replaced as the world’s reserve currency.

China’s military build-up is also continuing apace. Michael Mullen, America’s senior military officer, remarked in May that China’s re-armament seems “very focused on the US navy and our bases in that part of the world”.

But America is still capable of putting two fingers up to its banker, when the mood takes it. The Obama administration has just provoked rage in Beijing by imposing new tariffs on Chinese tyres.

So is China really a potential number one? Previous challengers to postwar American supremacy – Japan and the Soviet Union – eventually fell by the wayside.

In some ways, China is clearly a more plausible challenger than Japan. Japan’s population is about 128m, China has 1.3bn people. There are roughly four times as many Chinese as Americans.

But China still faces two very difficult transitions – economic and political. Now that the American consumer is taking a well-deserved rest, China needs to show that it can still grow rapidly, without relying on exports. Optimists point to this year’s economic performance to argue that “decoupling” has already happened – and that China now has enough internal demand to power its economy. Pessimists say the government has kept the economy surging forward only through a destabilising and wasteful surge of credit that is storing up problems for the future. A great deal will depend on who is right.

The government’s neurotic obsession with achieving its totemic figure of 8 per cent growth a year hints at the country’s continuing political fragility. Without a democratic mandate, the Communist party relies on rapid growth to keep the system stable. Somehow the country needs to make the transition to a system in which the government can draw upon alternative sources of legitimacy. Twenty years after the Tiananmen massacre, the Communist party shows no outward sign of contemplating a transition to a more democratic system. Meanwhile, the Chinese media speculate openly that social unrest could rise to dangerous levels, if economic growth slackens.

Unemployment is just the most obvious potential source of popular discontent in China. Environmental protests are becoming more frequent. Ethnic tensions in Tibet and Xinjiang have provoked riots.

Complaints about corruption and social inequality are also rising. That may be why the official media are so nervous about events such as the triumphal procession for a multi-millionaire’s pet dog.

The Chinese government keeps a very careful eye on the obvious potential sources of discontent – university campuses, internet chat-rooms and the like. But if political instability does return to China, it will probably be provoked by something quite unexpected. There are still plenty of things that can go wrong, before China becomes the world’s top dog.

– Gideon Rachman