A generation after the one-child policy began, the demographic shift has schools empty and seniors needing care.

Classrooms have become bedrooms equipped with bells to summon the nurses. And the clamor of more than 1,000 elementary school students has faded into the shuffle of slippers through the halls.

Four decades after opening its doors in Beijing, the Dongzhimen Elementary School reinvented itself last year as the Three Harmonies Senior Citizens' Home. The transformation reflects a vast and sobering challenge on China's horizon.

"There are very few young students anymore, but more and more elderly people," said Three Harmonies' manager, Wang Shuyuan.

A generation after China adopted its unprecedented one-child policy, the world's most populous nation is aging faster than any major country in history. The graying of the population, lost in the astonishing statistics on China's economy, threatens to hinder future growth and strain a frayed public-welfare system, say researchers in China and abroad.

"They are looking at 400 million old people 30 years from now, the vast majority of whom will not have pensions or health care or extended family," said Richard Jackson, director of the Global Aging Initiative at the Washington-based Center for Strategic and International Studies. "This is social and political dynamite, and the government knows it."

The problem is a peculiar side effect of progress. For most of Chinese history, people older than 60 rarely numbered more than 7 of every 100 people. But improved healthcare, sanitation and living standards since the Communist Revolution have allowed the average citizen to live more than 30 years longer than in 1949. At the same time, China has restricted family size since the late 1970s in an attempt to control population growth.

The result is a China-size version of America's Social Security crunch, in which there are neither enough offspring nor pension funds to finance tomorrow's retirements. But China faces an even greater hurdle, because its per capita income remains barely a tenth of U.S. levels. As economists put it, China is getting old before it has gotten rich.

Like most developing countries, China remains relatively young; those older than 60 make up just 11% of its 1.3 billion people. Such a large working population has helped fuel China's economic miracle by keeping labor costs low. Harvard researchers have calculated that up to one-third of the economic boom in East Asia can be credited to this "demographic dividend."

But things are changing fast. By 2050, those over 60 will make up 31% of the population -- higher even than the U.S. Short of a major change in the one-child policy, China will take just 25 years to age as much as Europe did during the last century, U.N. statistics show.

That comes as the same economic and political recipe that unleashed China's spectacular rise in 1978 has weakened the social safety net. State-owned enterprises once provided pension and health-care benefits, while Confucian duty compelled children to support their parents and grandparents.

But the shift to a market economy has sent roughly half the Chinese workforce into the private sector, where pensions are rare. And the search for work has pushed children farther from home, leaving many aging parents to find their own means of support. While reforms have helped lift 400 million Chinese from poverty, many are discovering that newly available health-care advances are beyond the reach of fixed incomes.

Traditionally, aging Chinese parents lived with their grown children. But the one-child policy means that a single child can be responsible for caring for two parents and even four grandparents.

The junction between those two demographic trends -- single children and aging parents -- explains how the Dongzhimen school became a retirement home. When it opened in the mid-1960s, the three-story school looked out on a country that averaged more than five children per family. But today Chinese families average less than two children.

Wang, 53, the manager of the retirement home, grew up in the neighborhood and lived that demographic shift. After graduating from Dongzhimen school, she became a kindergarten teacher.

"But a lot of kindergartens are gone now," she said.

So, like her old school, she went into the retirement business. The school had been shuttered for five years until September, when a private company took it over and divided the old classrooms into tidy bedrooms with twin beds, televisions and air conditioners. The most expensive rooms are on the first floor and go for $189 a month, a large sum by Chinese standards, making it available mostly to well-off retirees like former army officer Zhu Fawen, 79.

After his wife died last year, he found himself alone in a house he no longer could maintain. His three children, born before the one-child rule, have successful careers that leave them little time for Confucian-style doting, he says. "My granddaughter said, 'Who will cook for you and take care of you?' " said Zhu, who moved in last fall.