Dug into the rock with rudimentary tools, these century-old residences blend into the rocky slopes of Jabal Nefoussa, and beyond the borders - formerly non-existent - with Tunisia.
"We share this heritage (...). From Nalout (in Libya) to Gabes (in Tunisia), it is the extension of the same tribes", explains to AFP Youssef Al-Khattali, researcher in history.
Of different sizes and shapes according to usage, these cavities called "damous" in the Libyan dialect sink into the bowels of the mountain.
Temperate in winter and keeping cool in summer, they were "designed to have versatile uses and have endured over time, hence their importance in the history of Libyan architecture", underlines Mr. Khattali.
For centuries, the inhabitants of Ghariane, which culminates at an altitude of around 700 meters, lived there, prayed and buried their dead.
"There were first the troglodyte houses intended for humans and their animals, then the constructions designed as places of worship" - Jewish temples and Christian churches, most of which were later transformed into mosques - "but also burial places", as shown by tombstones "which date back to the Phoenician era", continues the historian.
Primitive methods
This construction technique was also used by the inhabitants to defend and protect their city from invasions.
Some constructions had a "purely military use. One can still distinguish the vestiges of the fortifications in certain places of the mountain and what remains of the watchtowers", says Mr. Khattali.
However, whatever the design method, size or use, the choice of location cannot be left to chance. It is necessary to know the nature of the rock to prevent the roof from collapsing during the excavation, made with the strength of the arms.
"My fifth great-grandfather built this underground courtyard 355 years ago" with simple tools such as the "gouffa", a basket woven in date leaf to transport the rubble, and a "tajouk", a kind of axe, says al-Arbi Belhaj, a descendant of a long line of Ghariani.
“Around the open-air square courtyard in the center of the Damous, eight families of at least nine members shared the premises,” he says.
Today, this owner of the oldest troglodyte house in Ghariane, boasts of being the "last grandson to be born there", in 1967.
Tourist attraction
Uncrowded due to the insecurity that has reigned in the country since the fall of Muammar Gaddafi's regime in 2011, the Berber towns of Jabal Nefoussa with their cave houses have long been a tourist attraction.
As early as 1936, Italy, the former colonial power in Libya, already gave it importance by publishing "the first tourist guide highlighting" these primitive constructions now abandoned by their owners in favor of standard housing.
Some dwellings are more than 2.300 years old, but few of them have left traces. About ten are still standing but only one troglodyte dwelling has survived and is now used as a "show house".
Occupied until 1990, the Belhaj family's damous has become, after restoration, a tourist attraction.
Visitors can wander from room to room for a small symbolic fee.
"Entry costs the equivalent of one dollar when you are Libyan, two dollars if it is a foreigner", explains Mr. Belhaj.
Families go there on weekends to discover these unusual spaces, have a cup of tea or "meet around a meal".