Scientists have discovered an unexpected leftover of the first world war on a Scottish university campus. A fungus, foreign to Scotland but relatively common in Europe, has been found growing in the grounds of the former Craiglockhart hospital where war poets Siegfried Sassoon and Wilfred Owen met in 1917.

Its discoverer, ecologist Abbie Patterson, believes British troops who visited Craiglockhart for treatment for shell shock brought Clavulinopsis cinereoides to Scotland after picking up spores on their boots while tramping through the mud of Flanders.

"Group photographs taken during the Great War show soldiers and nurses lined up on the very grassy bank where I discovered the fungus," said Patterson. "It is hard not to make a direct link between these soldiers and the fact that this fungus – which is completely foreign to Scotland but not to Europe – was growing there. Its spores may have been brought over to this country after being picked up by soldiers in the trenches."

As a result, a few soldiers who "cursed through the sludge", as Owen described it in Dulce et Decorum Est, have left a unique mark on their homeland, claims Patterson. Craiglockhart hospital, which is now part of Edinburgh Napier University, was used to treat shell-shocked officers during the war. Owen, who was sent there suffering from the condition and met Sassoon there, was strongly influenced and encouraged in his poetry by Sassoon.

After Owen died in action in 1918, Sassoon went to great lengths to make sure his friend's works were published. Their relationship formed part of Pat Barker's novel Regeneration, later filmed under the same name. In it Stuart Bunce played Owen, James Wilby was Sassoon, and Jonathan Pryce played William Rivers, the psychiatrist in charge of treating soldiers at Craiglockhart.

In fact, Owen and Sassoon were only two of several thousand men sent to Craiglockhart for treatment. The crucial point is that some may well have brought over spores of Clavulinopsis cinereoides to Edinburgh a century ago, said Patterson, who found the fungus while carrying out a biodiversity audit of the Craiglockhart campus.

"The purpose was to find every species that grows on the campus – so it takes a full year to do the audit. Just at the end of the season, in late autumn, the traditional time for fungus to appear, I discovered this sample. I could see it was a type known as coral fungus but was not sure which species … I sent samples to other scientists and they have since confirmed this is Clavulinopsis cinereoides."

The fungus has now been accepted and entered into records as a first for Scotland. "My specimen is now with the Royal Edinburgh Botanic Garden herbarium and is the only specimen they have of this species," he added.

Patterson said his biodiversity audit had uncovered several other rare plants in front of the old hospital. "These plants survived because the grounds of Craiglockhart were not treated with chemicals over the years. Weedkillers were not used here."