The Kasbah of Algiers has been a world heritage site for 20 years with its rich history, winding white-washed alleyways and enviable Mediterranean setting, but is now threatened by neglect and decay.
The city within a city, crowned by a 16th-century hilltop citadel overlooking the bay and studded with Ottoman palaces, hammams, mosques and souks, has been rocked down the centuries by earthquakes, fires, floods and conflict.
The "outstanding" value of what has survived gained official recognition in 1992 when it was awarded world heritage status. The UN Educational, Scientific and Cultural Organisation described the city as "one of the finest coastal sites on the Mediterranean".
But little has been done since, and certainly not fast enough, to preserve this unique medina, or Islamic city, from gradual decline, experts say.
Abdelwahab Zekkar, who heads the national office for the management of protected cultural assets, says a plan to renovate the Kasbah was launched only in 2007, and the studies were finished in May 2010.
"It took more than three years," he told AFP.
The buildings in the walled medina, more than 80 percent of which are privately owned, were largely abandoned during Algeria's civil war in the 1990s, when the warren of streets offered sanctuary to Islamist insurgents.
The Kasbah had done the same for Algerian nationalists during the war of independence against France 40 years earlier -- a struggle later immortalised in Gillo Pontecorvo's film "The Battle of Algiers".
The departure of many inhabitants also meant that people "did what they wanted", building in an unregulated, chaotic fashion, Zekkar said.
The French were to blame for damage done during the colonial period, when they knocked down the lower part of the town that connected it to the sea.
Wandering through the medina today invariably means surprises, like coming upon a palace or historic mosque, carefully restored houses and a team of Polish builders in charge of renovating the citadel.
But overcrowding, neglect and a disregard for sanitation are all too visible in the narrow streets, where rudimentary scaffolding props up the walls of houses on the point of collapse and stray cats forage in stinking piles of rubbish.
The flight of residents during the civil war failed to halt the long-term population boom, from around 30,000 inhabitants in the 19th century to some 52,000 now.
Adding to the problems it faces, the densely populated town is on a slope "so all the houses are supporting each other", Zekkar said. If one falls, "all the rest could come down with it."
The state has rehoused people whose dwellings are most threatened, giving rise to a common scam in which relatives, neighbours or friends move in and promptly demand new accommodation in their turn, according to Halim Faidi, an architect and Kasbah specialist.
But some residents like Nasser Eddine Meziane have taken on the task of trying to stop the rot.
He is doing up the house he inherited from his parents with the help of a few builders and some public funding.
"I'm just a simple worker who earns 18,000 dinars (168 euros / 224 dollars) per month, while the restoration will cost around 60,000 euros," he said.
"We've done nearly six months of work. We changed the ceilings, the floors and the drains. We had to strip the walls."
Algeria's burgeoning bureaucracy has played its part in hampering the renovation process.
A national agency is responsible for negotiating with owners who repair their houses and offering financial assistance, as well as for selling empty properties to be restored.
But that does not stop other authorities, such as the municipal council or neighbourhood committees, from disputing the agency's decisions and priorities.
"The Kasbah is still alive, but it's very sick," Zekkar said.
The authorities want to revive old crafts such as carpentry, copper and leather work, and the production of tiles, to preserve the traditions of a place so much a part of Algeria's history.
But Faidi the architect argued that, as far as the restoration of buildings is concerned, the work must go beyond simply reversing the Kasbah's decline and preserving its identity.
It must also anticipate the needs of its population in 20 years' time.
"The Kasbah is a town and the response should be an urban response," he said.