RIYADH // Climb the rickety ladder through the Emir Omar bin Saud Palace courtyard in crumbling Diriyah and the image of old Saudi Arabia suddenly appears in an adobe roofscape set against dark green palms.
The caramel tones of the mud walls, the smell of dust mingling with water and the muffled clanging of hammer on stone belong not to the kingdom's impoverished past, however, but a restoration project costing at least $133 million (Dh488m).
It was in Diriyah that the ruling Al Saud family first rose to power, and in memorialising its ruins, the authorities are celebrating a telling of national history that puts the dynasty and its clerical allies front and centre.
As capital of the first state built by the Al Saud in alliance with the revivalist cleric Mohammed ibn Abd Al Wahhab around 270 years ago, Diriyah is the Saudi Camelot.
"Diriyah is symbolic. It's about going back to your roots. The whole idea of the Saudi state started in Diriyah," said Khaled Al Dakhil, a political-science professor in Riyadh.
In school textbooks, national day posters and programmes on state television, the alliance and its revival under the modern kingdom's founder Abdulaziz ibn Saud is portrayed as delivering the nation from centuries of infighting and superstition and bringing unity, religious enlightenment and oil wealth.
It is a version of events that, while perhaps not applauded by some critics of the government and people from parts of the country that were conquered by the Al Sauds, nevertheless has solid roots in history.
The partnership of princes and clerics survived the Ottoman invasion, tribal feuding and a transformative oil boom to become the political fulcrum of a country many times larger than the remote desert emirate it succeeded.
While the Al Sauds and their Wahhabi creed gained recognition and influence internationally, Diriyah fell to ruin.
By the early nineteenth century, it was the largest town of the central Arabian Peninsula, its stout walls enfolding grand palaces for its princes, a treasury, a bath house and a large mosque.
But it was bombarded and burnt to the ground in 1818 by the cannons of an Ottoman army sent to crush Wahhabi fighters who had captured Mecca and Medina and raided southern Iraq.
Its wells were filled up and its palms cut down. Every archaeological dig uncovers a layer of ash, said Ali Al Moghanam, a historian working as an adviser on the project for the government body carrying it out.
The Saudi family and its followers trudged a few miles down Wadi Hanifa to resettle at Riyadh and Diriyah slowly melted into the desert. Today it is almost a suburb of north-west Riyadh.
Behind the ruins are a large pit where workers are making some of the one million mud bricks needed for the project. The United Nations Educational, Scientific and Cultural Organization (Unesco) accorded Diriyah world heritage status in 2010.
"Authenticity is very important to Unesco - making sure the modern intervention is well marked," said Thomas Ciolek, senior project manager in Diriyah for the Arriyadh Development Authority (ADA), the government's overseeing body.
The restorers envisage that Diriyah will become an open-air museum, with elevated steel walkways that will guide visitors through the shaded alleyways and towering palace walls that survived the Ottomans.
Abdullah Arrukban, director of urban development at the ADA, was not able to say exactly how much the restoration cost, but estimated that it was more than 500 million rials.
Ruins have been strengthened with internal titanium rods and freshly plastered using traditional methods, but have not been rebuilt, retaining the jagged silhouettes moulded by cannon shot and centuries of erosion.
When the project is complete - probably in early 2015 - it will use exhibits to detail the political history of the first Saudi state and its destruction, and of the life or normal people before the oil boom.
For Saudi critics and some people outside Najd, the arid central part of the Arabian Peninsula where Diriyah is situated, the careful preservation of these ruins is starkly contrasted to the treatment of other parts of the kingdom's heritage.
Some historic buildings in Mecca, for example, which was conquered by the Al Saud in 1924, have been allowed to decline or even in some cases been rased to make way for modern buildings.
"It is important to make Saudis aware of their history and proud of their history," said Mr Ciolek.
