SNP candidate Patsy Gowans was upbeat in the face of a second defeat at the polls within months yesterday.
Mrs Gowans lost her Elgin City North seat during May’s local authority vote, and failed to reclaim it yesterday.
But she said that giving eventual winner, Maria McLean, such a close run for her money had been a morale boost.
Mrs Gowans said: “I think the Tories expected a landslide win, given the general election result, but the gap was narrow.
“We were swimming against the tide, and we almost made it to the shore.”
Labour candidate Nick Taylor admitted that he had little expectation of winning yesterday’s by-election.
However, Mr Taylor said he was encouraged by what he views as a gradual upswing in Labour’s popularity in Elgin.
He said: “We have increased our share from the last council elections, which reflects the rebuilding process we are in.
“Two months ago, Jeremy Corbyn’s name was poison on the doorsteps but people are now becoming more impressed with him.
“More than a decade ago, five of Elgin’s six councillors were Labour and that is what we will keep striving to get back to.”
Independent Terry Monaghan won only 34 votes when he contested the Forres ward in May, but managed to secure 124 in Elgin City North yesterday.
The Army veteran said: “I ran a one-man campaign, which cost me personally about £2,000.
“A lot of people complain about the council, and I feel glad that I tried to put my head above the parapets and do something about it.”