Like many peasants from the outskirts of Yanan, China, Ren Shouhua was born in a cave and lived there until he got a job in the city and moved into a concrete-block house.

His progression made sense as he strove to improve his life. But there's a twist: The 46-year-old Ren plans to move back to a cave when he retires.

"It's cool in the summer and warm in the winter. It's quiet and safe," said Ren, a ruddy-faced man with salt-and-pepper hair who moved to the Shaanxi provincial capital, Xian, in his 20s. "When I get old, I'd like to go back to my roots."

More than 30 million Chinese people live in caves, many of them in Shaanxi province where the Loess plateau, with its distinctive cliffs of yellow, porous soil, makes digging easy and cave dwelling a reasonable option.

Each of the province's caves, yaodong, in Chinese, typically has a long vaulted room dug into the side of a mountain with a semicircular entrance covered with rice paper or colorful quilts. People hang decorations on the walls, often a portrait of Mao Tse-tung or a photograph of a movie star torn out of a glossy magazine.

The better caves protrude from the mountain and are reinforced with brick masonry. Some are connected laterally so a family can have several chambers. Electricity and even running water can be brought in.

"Most aren't so fancy, but I've seen some really beautiful caves: high ceilings and spacious with a nice yard out front where you can exercise and sit in the sun," said Ren, who works as a driver and is the son of a wheat and millet farmer.

The caves have an important role in modern Chinese history. The Long March, the famous retreat of the Communist Party in the 1930s, ended near Yanan, where Mao took refuge in caves. In "Red Star Over China," writer Edgar Snow described a Red Army university that "was probably the world's only seat of 'higher learning' whose classrooms were bombproof caves, with chairs and desks of stone and brick, and blackboards and walls of limestone and clay."

Chinese Vice President Xi Jinping, who is expected to succeed Hu Jintao next year as president, lived for seven years in a cave when he was exiled to Shaanxi province during the Cultural Revolution.

"The cave topology is one of the earliest human architectural forms; there are caves in France, in Spain, people still living in caves in India," said David Wang, an architecture professor at Washington State University in Spokane who has written widely on the subject. "What is unique to China is the ongoing history it has had over two millenniums."

In recent years, architects have been reappraising the cave in environmental terms, and they like what they see.

"It is energy efficient. The farmers can save their arable land for planting if they build their houses in the slope. It doesn't take much money or skill to build," said Liu Jiaping, director of the Green Architecture Research Center in Xian and perhaps the leading expert on cave living. "Then again, it doesn't suit modern complicated lifestyles very well. People want to have a fridge, washing machine, television."

Liu helped design and develop a modernized version of traditional cave dwellings that in 2006 was a finalist for a World Habitat Award, sponsored by a British foundation dedicated to sustainable housing. The updated cave dwellings are built against the cliff in two levels, with openings over the archways for light and ventilation. Each family has four chambers, two on each level.

"It's like living in a villa. Caves in our villages are as comfortable as posh apartments in the city," said Cheng Wei, 43, a Communist Party official who lives in one of the cave houses in Zaoyuan village on the outskirts of Yanan. "A lot of people come here looking to rent our caves, but nobody wants to move out."

The thriving market around Yanan means a cave with three rooms and a bathroom (a total of 750 square feet) can be advertised for sale at $46,000. A simple one-room cave without plumbing rents for $30 a month, with some people relying on outhouses or potties that they empty outside.

Many caves, however, are not for sale or rent because they are handed down from one generation to another, though for just how many generations, people often can't say.

Ma Liangshui, 76, lives in a one-room cave on a main road south of Yanan. It is nothing fancy, but there is electricity â a bare bulb dangling from the ceiling. He sleeps on a kang, a traditional bed that is basically an earthen ledge, with a fire underneath that is also used for cooking. His daughter-in-law has tacked up photographs of Fan Bingbing, a popular actress.