When Sir Frederick O'Brien's daughter heard about a new book on Vesuvius last year, she bought a copy for her father.

A leading figure in the Scottish legal world, Sheriff Principal of Lothian and Borders until 1989, he was in the Royal Army Medical Corps (RAMC) during the war. He'd witnessed the 1944 eruption of Vesuvius and, after reading my book, wrote enclosing his own account and some photographs. Earlier this month we met in Edinburgh. Sir Frederick greeted me at the garden gate, a dapper man who's just passed his advanced driving test with flying colours, a month off his 95th birthday.

Until his family cajoled him to record his long and distinguished life, Sir Frederick hadn't reread his wartime journals. As he told me in his neatly organised study, a computer on the desk: "I tried hard to forget the war and it's difficult to talk about, even now." But perhaps memories of Vesuvius offer their own comfort. As General Harold Alexander's combined Allied forces struggled to break the Gustav line – at terrible cost of lives as the American 5th Army, under General Mark Clark, and the British, Commonwealth and Polish forces of the 8th Army, under General Bernard Montgomery, attempted a pincer movement around the Germans – the volcano provided a spectacular diversion for the observant through these tough months.

After Cairo and Tripoli, Sir Frederick's unit went to Sicily in July 1943. Then, out of the blue, they were switched and in early September they flew into Salerno, heading straight towards German positions although, as he says with relief, that at least we didn't have to go through the landings. They were to provide field blood transfusions during some of the toughest engagements in the war, culminating in the destruction of Monte Cassino in May 1944.

Extraordinary as it may seem to us, the actual eruption of Vesuvius in March 1944, though devastating for local people and deadly for a few, came almost as light relief since. As Sir Frederick says: "It took us away from the war for a bit."

Norman Lewis, who served as an intelligence officer with the 5th Army (and who was no admirer of Clark) gives that impression too, in his vivid record of this time, Naples '44. In fact, as Sir Frederick tells me sheepishly, his journal was illicit since diaries were forbidden lest they fall into enemy hands. But it has proved invaluable.

As the RAMC unit arrived in Castellammare in October 1943, the volcano, clearly visible to the north, was stirring. Two red fingers of lava, dramatic in the blackout, signalled that something was afoot. They glowed near the summit, he wrote, "one quite large and fiery - It flares up every half minute or so". By day the lava spill could be seen heading down towards the coast. And Castellammare had form; it was the site of the Roman town of Stabiae, smothered during the AD79 eruption, along with Pompeii and Herculaneum.

After weeks in which his blood unit was based around the bridge at Volturno, once being caught between fire from both sides, Sir Frederick fell ill with jaundice and was taken to hospital in Naples. He was too sick to know that the ambulance was strafed on the way. But convalescing at Sorrento in November, he summoned up the energy to visit Vesuvius, which he describes as quite a challenge. He shared a truck with some South African officers, to the point where the track became blocked by solidified lava.

"After clambering over layers of cinders," he writes, "we found ourselves under clouds of smoke and fumes smelling of sulphur." There was a continual crashing noise from the crater, with "lumps of material flying about" – he lifts an ashtray to demonstrate – "about this size! Italian boys were up there. They dropped coins into the molten material and, when it was cool, they took them down to sell." Even then, Vesuvius was providing a useful living for Neapolitans.

When the actual eruption came, on the evening of March 18, 1944, it was a very different experience. By then the unit was north of Pozzuoli, not far from the spot where Pliny the Elder spotted signs of the AD79 eruption. Like him, Sir Frederick went to admire the fiery mountain before going to bed. The following day, they were taking blood from an artillery battery, "near enough to Vesuvius to have a good view of the immense column of white smoke rising high above it – nearly twice the height of the volcano itself". The lava was flowing downwards and the mountainside hotel was stranded between "streams of seething lava". Sir Frederick saw it much as the 18th-century painter Wright of Derby did, with the spectacular volcanic firework display continuing for a couple of days.

In the streets of Naples, Sir Frederick writes, people stood watching an "immense cloud of white smoke ... a tremendous sight, both on account of the staggering height it reached – perhaps 15-20,000 ft – and because of the finely shaped billows of steam pushing their way high up from the invisible crater". At that moment, a soldier friend of his was disembarking in Naples, to find the harbour wreathed in dense smoke. Even San Gennaro, the miracle-working patron saint of Naples, was under attack. Retreating Germans had blown up his statue and the bridge on which it stood, marking the point where the lava stopped at the saint's behest during the eruption of 1631.

Sir Frederick and his friends decided to get closer. He travelled up, hanging on to the tailboard of a truck until they could drive no further, confronted by "a high barrier of black lava" surreptitiously moving onwards. He had his camera and recorded the surreal scenes. At Pugliano they watched the railway station being crushed and then set alight in the heat. Conducting their own experiment, they followed some Italian boys who clambered on to the cooling lava surface, yet, as he recalls "when a stick was inserted into a crevice it came out in flames".On the other side of the volcanic debris, they found the remnants of Thomas Cook & Son's funicular, its empty coaches stranded. He wondered if they would ever be used again.

As he wrote in the diary, the all-consuming sluggish lava river was terrifying, even in wartime. "I think it is the inevitability and utter finality of volcanic destruction which impresses me most - for all men's power with machines of destruction there was not a man in the world who could lift a finger to control the sluggish advance of that lava stream. And once the railway was covered, it was more finally put out of action than if it had been bombed by the RAF." He struggled to find the language to describe this glimpse of "the bowels of the earth - it's no use trying to think what else it looks like. It was awesome, but dead". Yet in the distance came "sounds of life from the volcano itself", a continual soundtrack. "Now and then there came an especially loud roar from the crater, and above the cloak of smoke and mist surrounding it would surge up great billows of greyish vapour, high above the shroud."

Like many volcano-watchers before them, Sir Frederick and his friends took time off and went to the opera. The eruption was now setting up weird electrical displays – "flashes of lightning sparked here and there across the summit".The next evening, at Madame Butterfly, they wondered if extra effort had gone into the theatre's ambitious lighting effects. But the curtain-closer in these unfolding natural special effects was a dense blanket of volcanic dust, coating the entire landscape.

The road to Salerno was blocked by ash up to four feet deep. Sir Frederick writes: "The dust and ashes gave a strange ashen-grey appearance to the countryside – just as though you were looking at it through dark glasses. Trees, crops, houses, roads and flowers – all had their coating of grey dust." Even Pompeii had a thin dustsheet.

The war neared its conclusion and Vesuvius fell quiet. In mid June their unit, two vehicles led by a gritty Glaswegian doctor, drove into Rome, ignoring the signs, "American troops only". It was another triumphant moment but still not, I suspect, quite as good as the day Vesuvius had erupted in front of them.

Vesuvius by Gillian Darley published by Profile Books is out now in paperback, £8.99