For six years, the organisers of the Beijing Olympics have been planning an event that will restore China to the centre of the world stage.

No expense has been spared, no detail overlooked. Beijing has splashed out $440m (£224m) on the spectacular "Bird's Nest" stadium to underscore its rising economic power and ambition. Organisers have drawn up a guest list of the global great and the good to witness the re-emergence of this ancient civilization. And to entertain them and emphasise the openness of modern China, they hired the biggest name in Hollywood to help choreograph the festivities.

But with less than six months to go, this celebration of Chinese resurgence is threatening to degenerate into an opportunity for critics to land some blows on the communist leadership.

The stadium architect, Ai Weiwei, refuses to attend the opening ceremony because of the "disgusting" political conditions in the one-party state. The VIP list will not include Prince Charles, a friend of the Dalai Lama, who told the Free Tibet movement that he will be absent. And now, in the biggest blow yet, Steven Spielberg has resigned as artistic consultant, saying his conscience will not let him choreograph an event for a country that has done little to use its influence to ease the slaughter in Darfur.

The Chinese leadership is scrambling to limit the damage and prevent the Spielberg boycott from escalating into a wider movement. A top Communist party official, Xi Jinping, has been parachuted in to lead preparations, it emerged yesterday.

Of primary concern will be the steady drip of bad news stories suddenly contaminating the Olympic run-in. The opening of the "water cube" Olympic pool in late January was overshadowed by reports that construction worker deaths have been covered up for more than a year. A week later, police arrested a high-profile dissident, Hu Jia, prompting accusations by human rights groups that the government is silencing critics before the games. The negative PR went international when Spielberg walked off the set and a group of Nobel peace prize laureates, politicians, celebrities and former Olympians sent an open letter to the Chinese president, Hu Jintao, calling on China to act against the atrocities in Darfur.

China appears unsure how to respond to the sudden challenge. The domestic media have railed against the politicisation of the games, the foreign ministry has spoken darkly about the "ulterior motives" of some critics, and it has clamped down hard on domestic activists who dare to use the Olympics to press for political change. Next week, a court will hear charges of subversion against Yang Chunlin, who petitioned against land seizures with the slogan: "We don't want the Olympics, we want human rights."

That the biggest press battering has come over foreign policy is unexpected. "China's foreign ministry is confused," said Nicholas Bequelin of Human Rights Watch. "They have been getting rave reviews from western diplomats and the United Nations for their role in Sudan, Burma and North Korea. But now in terms of public opinion, this is becoming a disaster. It is a wake-up call to them in terms of the risks that the games pose to China's global image. I think this is just the beginning in terms of expression of concern about human rights."

Bequelin added that criticism of China should not drown out some of the positive advances - such as poverty alleviation and increased personal freedoms - made in recent years. China has relaxed controls on foreign journalists and invested significant political capital in trying to clean up Beijing's environment.

The Olympic organisers have also hired a foreign public relations agency, Hill & Knowlton. Professional advice has been credited for the restrained response by Beijing to Spielberg's resignation, which the Beijing Organising Committee described only as "regrettable".

"We are consulted for the press releases," said an employee. "We emphasise that politics and sport should be separated."

In this at least, China has the support of one important multilateral body - the International Olympic Committee which insists that its games are no place for political display. At Olympic opening ceremonies the entire world marches in step, North and South Korea side-by-side, Lebanon alongside Israel.

Yet for many the IOC's position appears to ignore the enormous credibility conferred on the host city, and many who voted for China to host in 2008 did so in the belief that their support would help hasten reform. The IOC's leaders may be idealistic but they are not naive, and they are well aware of the sensitivities that will be stirred by China's games. They are also conscious of the platform that the games provides for campaign groups.

The same thing happened in Greece four years ago, and in Sydney before that, and should the UK still be embroiled in conflict in Iraq and Afghanistan four years hence, London can expect plenty of heat.

Many in the Olympic movement are nervously awaiting the first confrontation between protesters and police played out in front of the world's media.

More than 20,000 journalists have been accredited for the games, double the number of athletes, and their unfettered comments on everything from the quality of the sport to the state of the trains will be a huge shock to the Chinese culture of control.

Qiao Mu, the director of international communication studies at Beijing Foreign Studies University, said the government could no longer ignore foreign opinion.

"China needs big events like the Olympics to prove itself as a powerful nation," he said. "In Mao's days, the government did not need to care about the foreign media because they were easily able to ban information easily and live in the fantasy they created for themselves. But now that we live in an age of globalised information, the government must pay more attention to outside opinion."

In the next six months, he says, China will have to live with a lot more negative coverage. "It is the character of the media to dig up the dark side of events. They like to focus on that."

There is scant likelihood of a broader boycott. President George Bush has clearly distanced himself from Spielberg and other protesters. "It's up to him. I am going to the Olympics, I view the Olympics as a sporting event," Bush told the BBC. "There are a lot of issues that I suspect people are going to opine about during the Olympics - the Dalai Lama crowd, you've got the global warming folks, you got Darfur ... I am not going to go and use the Olympics as an opportunity to express my opinions to the Chinese people in a public way because I do it all the time with the president."

Gordon Brown has also promised to attend. In advance of the London games in 2012, Britain does not want the precedent of a disrupted Olympics.