An earthquake hit a small place of 1,300 souls in Slovenia called Kobarid on 12 July this year. Nobody was killed but 353 homes were damaged, the worst shock for the village in decades. In neighbouring Italy, nobody noticed. But if Kobarid had gone under its former name, it would have been an item in every paper in the land and doubtless on everybodys lips.

Kobarid, in fact, was once called Caporetto, the scene of the worst military defeat in Italian history, a black milestone during the carnage of the first world war.

The word Caporetto is now spoken in a hushed voice in Italy as a synonym for disaster, catastrophe, humiliation. It even makes English-language encyclopaedias, defined as overwhelming military defeat.

Nowadays Caporetto, in the extreme north-west of Slovenia, is a placid tourist resort of striking beauty frequented by hikers and cyclists, while overhead, hang-gliders in brightly-coloured chutes drift lazily over mountains and valleys. Here, in 1917, Austrian and German attackers put the Italian army to wholesale flight. It is the tragic background to Farewell to Arms by Ernest Hemingway, an ambulance driver on the Italian front at the time. A large photo of him now dominates the staircase of the memory-packed local museum.

Who was to blame? It is a question still being thrashed out, but any newcomer to the sleepy village today can only be astonished at the setting of the debate.

Caporetto lies in a pod-like valley of green meadows at the bottom of one of natures frightening trenches, towered over on either side by the sheer walls of cloud-piercing mountains. What can only amaze is the unbelievable tenacity of men from both sides who 80 years ago clung on to their position for months, not in the cushy valleys, but strung out along the forbidding ridgelines of those jagged mountains. As an example, the key peak held by the Italians was on Monte Nero, or the Black Mountain ( 2,245 m), capped by snow even in August.

Italys objective during the first world war, which it entered at the last minute in 1915 on the side of Britain, France and Russia, was to retrieve what it saw as Italian territory unfairly ceded to Austria by treaty in 1866, including South Tyrol up in the Alps, the Austrian border town of Gorizia far to the east and the port of Trieste.

Things started well, as documented in the museum records, with the Italians walking unopposed into then Austrian-held Caporetto, laboriously to fortify its heights. But for the next two years, the war was suicidal, fighting up against the Austrian border to the south, with the Italians hurling a succession of offensives against ferocious opposition. Each attack devoured thousands of lives on both sides often for the sake of only a few hundred metres of ground, seized and lost time after time.

Italys troops were poorly trained and inadequately equipped, without even helmets at the outset. They were hectored forward into the often-fruitless assaults by a ruthless commander from Piedmont called General Luigi Cadorna, a disciplinarian of draconian methods. He placed Italian carabinieri, paramilitary police, behind the backs of the troops, and ordered them to shoot deserters dead.

Forced into it, the boys somehow prevailed and a big moment for Italy was when they at last seized Gorizia, still Italian today. Whipped into one last effort, they then pushed the Austrians off a strategic mountain plateau in sight of the Black Mountain, whereupon Cadorna halted his war for the winter.

Ironically, Italys very victories were to blame for the humiliating sequel. Fearing an Italian breach of their lines, the Austrians readied a massive counter-attack, though this time with the help of crack German units, spearheaded by a sole battalion under Captain Erwin Rommel, the future Desert Rat of world war two, General Montgomerys legendary opponent in north Africa.

On 24 October 1917, Rommels men, under the cover of darkness, precision shelling and a surprise gas-attack, slipped unnoticed between Italian units in the mountains. They were down in undefended Caporetto 24 hours later, with 10,000 Italian prisoners of war on their hands and the rest of the Germanic army already pouring through the opened gap.

It took the Italian command, with their phone lines cut, three whole days to realise what had happened. By then it was too late. Chaos had broken out and about one million panic-stricken soldiers were running for their lives in the direction of Venice, their gains in the murderous fighting of the previous two years thrown to the wind within hours.

Attempting to shift the blame, Cadorna at once publicly accused his own men of having withdrawn like cowards without a fight, ignominiously surrendering to the enemy. For historians today, the fault instead lies largely with the generals themselves: convinced that fighting was over until spring, the Austrians had taken them off guard. They had expected a frontal attack over the peaks, and so never trained their binoculars on to the defenceless valleys. But it is certain that what turned a defeat into a rout was a collapse of morale among the troops, wrote the late popular journalist-historian Indro Montanelli in Storia dItalia.

Yes, a streak in the Italian character was a factor in it all, the Slovenes at the museum in Kobarid acknowledged with a smile. The troops were mainly bewildered country boys from the deep south, more interested in the mandolin and love songs than in our peaks up here. They used to say: But weve got mountains of our own!

Finally, the Italian army regained its honour. Attacking seven months later from a new front line on the River Piave, 100 km away from Caporetto, they threw back the army of the already tottering Austrian Empire, reoccupied all lost ground, and had the map of Italy duly redrawn to (nearly) everybodys satisfaction.

Today, the concrete trenches and the gun positions are still there in the mountains, and overlooking Korabid from a hilltop is a grim, three-tiered charnel house set around an old church resting place for the bones of 7,014 Italians. The monument could be taken as a poignant statement that Italians prefer peace and being with family to war and death, a concept now enshrined in the Italian constitution and reflected today in the unaggressive stance of the Italian peacekeeping force in Iraq.