By 2020, China will have overtaken Japan as the world's second biggest economy. It may even have started to rival the US in terms of the hard power of its military. But if it is to achieve the government's goal of once again being the world's leading civilisation, the country will also have to acquire the "soft power" of universally appealing values.

How can it do that? Paradoxically, the best hope for softening China may be the same thing that poses its greatest threat: the HIV/Aids epidemic. China is on course to suffer the biggest epidemic of Aids in the world, but in the process it may find the illness acts as one of the main drivers for social change over the coming years.

"By 2020, Aids will have transformed society," says Wan Yanhai, an Aids activist who was arrested two years ago for disclosing details about China's HIV problem, which was then deemed a state secret. "Both people and the virus will be more active in China. It is not something we can ignore. People have to ask questions about their way of life, they have to get involved in social politics and get organised. From my personal experience I'm absolutely certain that this kind of activity will lead China towards a democracy."

It is already possible to get a glimpse of China in 2020. It is an impressive sight. Barring a war over Taiwan or an economic crash - both distinct possibilities - the country will have been transformed by the greatest spurt of development in world history. Beijing - currently thick with cranes and noisy with hammers and drills - will have hosted an Olympics to dwarf all its predecessors in terms of scale and spectacle. With annual growth of more than 7% per year, Shanghai, the country's commercial capital, will have overtaken Tokyo, Hong Kong and Singapore as Asia's leading financial centre. Further south, Guandong province will be the unrivalled workshop of the world. Its giant factories on the Pearl River delta will not only be churning out the labour-intensive goods of old, but also cutting-edge products developed by China's premier institutes of nanotechnology and cloning.

China will have become a land of superlatives. By 2020, a host of world-beating projects will be completed: the biggest hydroelectric project, the Three Gorges Dam in Sichuan Province; the longest bridge and tunnel, near Shanghai; and the highest railway, which will rise above 4,000 metres through the Himalayas to connect Tibet with Qinghai.

China will also be leading the world, reluctantly, in HIV/Aids. According to government estimates, the world's most populous nation had 840,000 cases of the disease in 2003. That amounts to less than 0.01% of the population, far lower than the 35% infection rates in parts of sub-Saharan Africa. But with the number of new cases rising at between 20% and 40% per year, the United Nations has warned that China could have 10 million cases by 2010 - double the number at present in South Africa, which is currently the world's worst affected nation.

Despite the huge numbers, health officials insist the disease will not derail China's economy. According to the government's latest HIV/Aids impact assessment, the epidemic will cost the country no more than 15.9bn renminbi (£1.1bn) by 2010 - equivalent to only 0.03% of GDP. But that optimistic view was contradicted last year by the former US president Bill Clinton, who warned that lost working hours and rising health costs could derail progress.

"China is moving in a positive direction. The headlines are hopeful and the future looks bright," he told a conference at Tsinghua University last year. "But the weight of 15 or 30 million people living with HIV/Aids could blunt a lot of your progress, especially if the burden falls most heavily on young people."

Officials admit the figures are guesswork. Government cover-ups, social taboos and a dilapidated healthcare system mean very few cases of HIV/Aids are reported. Some provinces, led by Yunnan - a major centre for the drug trade - have been very open about their problem and have sought international help to establish condom promotion and needle-exchange programmes that ought to help control the epidemic by 2020.

Earlier this year, the government followed that lead, extending Yunnan's policies across the country, as well as offering free tests and treatment to sufferers. But not all China's rulers have been so decisive. Henan province, for example, continues to cover up a blood-collection scandal - in which villagers sold their blood en masse, with the result that infected blood became mixed in to the supply - that produced infection rates of more than 50% in countless villages. Official figures suggest Henan has 40,000 people who are HIV-positive, but Aids activists believe the figure is over 1 million and rising because infected villagers are migrating to work in cities and their tainted blood is still being used in hospitals. Given that 23 provinces ran blood-selling operations, the problem could be widespread.

"I'm still very pessimistic about the control of Aids, especially about its spread," says Gao Yaojie, a local doctor who received international plaudits - and official intimidation - for helping to expose the problem in Henan. "The government has started to act on blood collection, but it hasn't done anything on the [black market] blood transfusion problem, which is also very serious. In Henan, Inner Mongolia, Guangdong and Sichuan, there are many underground clinics which offer cheap - and probably polluted - blood."

An equally grim picture is painted by Wan Yanhai,who has set up an NGO called Aizixin in Beijing. "I don't think that infection rates will slow over the next 10 years," he says. "The government has not invested enough in intervention and it is still underplaying the scale of the problem. My guess is that there are already 5 million to 10 million cases. By 2020, this will rise above 20 million."

The World Health Organisation disputes those claims, saying the government has done enough to keep the epidemic in check. Dr Zhao Pengfei, the HIV-Aids coordinator at the WHO's Beijing office, believes that by 2020 the target should be to keep the number of cases below 5 million. "Even in the worst case scenario, I don't think there will be 10 million cases by 2020," he says.

But he warned China must brace itself for the disease spreading from the current high-risk groups of blood-sellers and drug users - who are mostly concentrated in inland rural communities - to sex workers and the general population in urban areas on the eastern seaboard. Zhao's biggest concern is that gay men could pass on the disease to their wives and children. "Because of social pressures in China, most of the gay population is married and lead bisexual lives, so they could act as a bridge for HIV to cross into the general population," he says. "But social stigma has constrained the government from developing a policy to reach out to this group, even though measures are now in place for sex workers and drug users."

The fact that these things can be discussed openly represents a significant break with the past. That - and the influx of international funds to deal with the crisis - explains why so many of China's sharpest minds are drawn to working in the fight against Aids, which is now attracting the sort of idealists who would have been campaigning for democracy 15 years ago.

The slaughter of students and civilians in and around Tiananmen Square in 1989 has taught subsequent generations that engaging in direct political confrontation is dangerous and futile. Graduates of the country's top universities are now more likely to concentrate on making money - either through business or the Communist party. But for those still driven to change the world, HIV is an opportunity. Whether they work as healthcare professionals, journalists or NGO volunteers, they can not only help the sick, but highlight the growing threat of the disease as a means to indirectly shape China's values.

This reform by stealth is working. As the Sars crisis demonstrated last year, health is a vulnerable spot for a communist government that has presided over a growing income gap between rich and poor and a steady deterioration in the quality of rural hospitals. It has also become an opportunity for the new leadership of the Communist party to prove its compassion. Last December, in a marked break with his predecessors, Prime Minister Wen Jiabao visited an Aids hospital, where he told a patient: "We need care and love, equality and opposition to prejudice."

Many NGOs and health workers see the more compassionate approach to Aids as a sign that the government has shifted from a single-minded pursuit of economic growth to a more holistic policy of balanced development."HIV is already making a huge impact on society," says Lily Liquing of Marie Stopes International, one of an increasing number of foreign NGOs that have been allowed to operate in China. "It is helping to nurture a civil society and greater internationalism because the authorities and NGOs are working with their counterparts overseas in ways that wouldn't have been imaginable before. Homosexuals are getting organised for the first time, schools are working harder on sex education, and women are more conscious of family planning issues. HIV is bringing some very positive social changes. It has brought problems out into the open. We are seeing less taboos in China now."

While the disease has made life a misery for countless Chinese, it also appears to have given others strength. Ren Guoliang, a 23-year-old Aids activist, had to give up his job in the army and he now conducts lectures, works with an Aids hotline and appears on television to talk about the disease. Although he does not expect misunderstanding and discrimination to disappear for many years, his life has been made easier by the government's increased openness and the provision of free retroviral drugs.

"In 2020, I believe China will have more democracy, that there will be better policies for care and treatment of Aids. Civil society will have matured and we'll be more open about the disease, which will help to control its spread."

But he also fears another bleaker version of the future. "If the government fails to keep up the recent good momentum, Aids will spread out of control. It will be a disaster threatening millions of lives. China will be the next Africa."