At his office in what was once a schoolhouse in a town that 60 years ago sheltered 1,700 residents but now is down to 124, Mayor Antonio D'Aloisio offered a visitor a brown cookie he said was made the way it was a thousand years ago, in an old oven from unrefined, local flour.

In the mayor's view, the tough cookie of the past symbolizes the future for Santo Stefano di Sessanio. "We want to revive our village by renewing our history. Santo Stefano's wealth lies in its medieval history and we are going to preserve it," he said.

Santo Stefano, a two-hour drive northeast from Rome in the rugged Appennine Mountains, is one of about 2,800 ancient Italian hamlets, from the far north all the way south to Sicily, at risk of extinction. Marginal farmland, distance from cities, lack of jobs and the difficulties of maintaining cramped antique housing have driven off tens of thousands of inhabitants over the past century.

The remaining population is mainly old and retired. Santo Stefano's school has been closed for a decade. The five students living in the hamlet commute down a winding road to a school in another town. There is no post office or health clinic, and the streets are almost empty. The flocks of sheep whose wool was highly valued by Florentine manufacturers have disappeared from the grassy mountainsides.

Over the past decade, preservation groups have sounded the alarm, contending that such places must be saved as an irreplaceable link to Italy's rural and artistic past. Last spring, a civic organization representing hamlets across Italy proposed a law that would offer tax incentives to people who move to endangered villages and that would provide financing for local governments to restore decaying buildings, streets and waterworks.

But whether rich Italy can revive the hamlets that poor Italy fled is open to question. Small, out-of-the-way towns are not the only ones clamoring for restoration and development funds. So are many large Italian cities.

Venice has embarked on a multibillion-dollar program to build a system of mechanical dikes to regulate the flow of water in and out of its lagoon and reduce winter flooding. Rome is working to renew the facades of palaces and scrub soot from the walls of ancient ruins. Naples is building a subway system to alleviate traffic on its notoriously jammed streets, yet funds are lacking to build incinerators for the garbage that piles up in makeshift dumps all around the city.

"We have a problem that we have to compete with places that have more political clout than we do. On the other hand, the danger that we might disappear is greater, so we hope this is taken into account," said D'Aloisio, a retired industrial mechanic.

Private enterprise has invested in some beauty spots, although such development often means turning a remote hamlet into summer condominiums or a tourist destination for foreigners, providing only seasonal life.

A handful of European buyers have purchased vacation property in Santo Stefano, and D'Aloisio is hoping that the town also will attract permanent residents.

But what can Santo Stefano provide that is different from what scores of other ancient towns are already offering? That's where the medieval cookies come in. They were baked by a former resident who lives on Italy's west coast. Town officials are scouring central Italy for people like her who practice rustic tasks: baking, carpentry, wool spinning and dying, and the cultivation of lentils, once a mainstay of Santo Stefano. They want to persuade them to return for good. (The cookie baker has not).

Town hall also wants the village to remain true to Italy's past. It is prohibiting new construction around Santo Stefano. Electric lines are to be put underground. "When visitors come to Santo Stefano, they will see an authentic example of the past -- without, of course, the inconveniences of the past," D'Aloisio said.

The village's history follows a pattern common to many rural areas in Italy. It was a feudal redoubt with land owned by aristocrats and populated by ragged tenant peasants. The wealthy Medici family took over Santo Stefano in the mid-1500s to provide wool for its Florentine mills. "The Medicis were a kind of Italian multinational," D'Aloisio remarked.

Nineteenth-century warfare upended feudalism. The beginnings of industrialization attracted peasants to cities. Others moved abroad. Two world wars triggered new exoduses, and the so-called economic miracle of the 1960s and '70s did not reach here.

Local people say they are not nostalgic. "It was a time of sadness," said Gustavo Mecoli, a retired air force officer. "The only reason anyone stayed at all was because they got some money from a relative working in a foreign country."

Like the ghost towns of the American West, places such as Santo Stefano see their salvation in tourism. Four years ago, Daniele Elow Kihlgren, son of a Swedish father and Italian mother, decided Santo Stefano could compete on Italy's crowded stage of attractions. With money from the sale of family land in Pescara to the west, he bought about a third of the hamlet's available, crumbling buildings. He is restoring them in line with D'Aloisio's ideas.

Broken staircases were replaced with old marble bought from country stores that sell scavenged building materials. Kihlgren pulled up old wooden flooring and hid plumbing beneath. To preserve the patina of age, he stopped short of refurbishing walls blackened by soot from old fireplaces.

He wants his hotel, scheduled to open late this year, to be the anchor for Santo Stefano's development. Like the mayor, he does not want modern construction. "This village missed the Italian building boom of the last many years," he said. "That's a blessing." He gestured out to the empty space around the old town walls. "People who visit here will experience the true Italian landscape," he predicted.

This kind of Colonial Williamsburg effect is rare in Italy. Even Venice has a few modern buildings within its treasure of ornate palaces. Other modernity-free villages have been preserved thanks to geology.

Take Civita di Bagnoregio, another struggling village 90 miles north of Rome. A tightly packed hive of stone houses, churches and civic buildings, it sits atop a plateau, cut off from nearby hills by steep cliffs and verdant canyons. It is connected to an approach road by one narrow concrete bridge built in the 1960s. Only 14 native residents live in the village, although dozens of foreigners have refurbished stone houses along its winding lanes.

Like Santo Stefano, it is now trying to attract permanent residents. However, it faces a vexing and dangerous problem. The sides of the plateau, composed of soft earth, are flaking away. A few houses on the periphery have cracked in half as earth slid downward.

In response, town officials initiated a complex engineering scheme. Instead of building scaffolding outside the cliffs to reinforce the fragile terrain, engineers are constructing it inside the mountain. Concrete shafts will anchor bars that will run horizontally to the cliff face, in effect creating a skeleton to hold the earthen flesh together.

Civita's struggle bemuses Peppone Medoni, a 90-year-old native. He has endured the Nazi occupation, lean postwar years and now the arrival of summer visitors with their cameras and endless curiosity about Civita's past.

"Our problem with the falling cliff is nothing new. We had an earthquake in 1695, I think, that brought down half the town. Also, the Germans blew up the old bridge to Civita, and we had to put planks over the way to get to the mainland," he said, speaking of his home town as if it were an island.

Until his retirement 30 years ago, Medoni delivered firewood, food and other material by donkey to the village across the bridge.

His wife, Maria, sat in their garden not far from where the cliffs are peeling away. She greets tourists who stroll in to look at the couple's collection of farm utensils and donkey saddles.

"It's nice they are trying to save the town, but it can never be what it was. We will never have schools again, never have a post office. Children aren't born here. It's not really a town anymore. It's a museum," she said.

Civita di Bagnoregio, perched on a plateau north of Rome, is one of many ancient Italian hamlets seeking funds to restore crumbling buildings and rebuild its population.Peppone Medon, one of a handful of native residents remaining in Civita, says it can never be what it was.