Volunteers who look after railway station flower displays said they had banished the menace from a platform waiting shelter using eucalyptus plants.
The success has prompted calls for the experiment to be repeated at other midge-infested locations on the west coast of Scotland.
Louis Wall, a volunteer gardener who helps to maintain displays at stations in south-west Scotland, hit upon the solution when asked to tackle a midge blackspot at Barrhill station, on the Glasgow-Stranraer line in South Ayrshire.
Wall said the infestation was so bad it had caused lights in the shelter to stop working because of midges homing in on fluorescent tubes and wiring. He said this had forced ScotRail to send engineers on 100-mile round trips from Glasgow every fortnight to fix the lights and clear hordes of dead midges covering them.
Wall said the insects had been driven away by the lemon smell emitted by the lemon eucalyptus plants – Eucalyptus citriodora. He said he had put six plants together in the shelter to ensure they produced a powerful enough aroma.
Wall, who was shortlisted in the outstanding voluntary contribution category at last year’s Community Rail Awards, said the eucalyptus had worked because it was in a confined space, which also protected the plants from potentially fatal wind chill.
He said: “The midges went for the light fittings which caused failures. Passengers may also have been bitten.
“The plants have been very effective in stopping the midges. We used to get bitten a lot working in Barrhill, but have not been bitten in the shelter this year since we planted the eucalyptus in May.
“I can’t see why others shouldn’t try planting eucalyptus lemon bush elsewhere.
“It obviously helps when an area is more enclosed, like in a shelter, as more of the lemon scent will remain in that area.”
The Friends of the West Highland Lines said the plants could also have a role in keeping midges at bay at stations on the routes to Oban and Mallaig, such as Helensburgh Upper, which has an open shelter like Barrhill’s.
Strategy officer Dr John McCormick said: “Some of these stations must be the midgiest in the world, which can drive people round the bend. The West Highland midge is even worse than those in the south-west – and there are certainly more of them. The plants would be a great idea if they worked.”
Scottish tourism is estimated to lose £286 million a year from visitors advising their friends not to visit at the peak of the midge season in July and August.
A ScotRail spokesman said: “It’s an added bonus for our customers if the dreaded midge is being repelled by a plant. The volunteers are creating a more pleasant environment with their flowerbeds and plants, and we’re delighted if their efforts to brighten stations are midge-free.”