"Yeeessss," cheered a member of the Conservative party faithful.
By Steven McKenzie
BBC Scotland news website
Sadly for the Tories, this was not in response to a victory at the ballot box, but Middlesbrough's dramatic win over Steaua Bucharest to book a place in the UEFA Cup Final.
Richard Lochhead was declared the winner in Moray
A small group of Conservative supporters had taken a break from the count to watch edited highlights of Boro's come back from 2-0 down to win 4-2 on a TV in a room upstairs from where the count was taking place.
But as they savoured the goals replayed on the TV, downstairs their candidate Mary Scanlon could not expect to emulate the football team's remarkable feat.
As late night Thursday slipped into early Friday morning, it soon became clear that the SNP's Richard Lochhead was headed for by-election glory.
The count kicked off at 2210 BST after the referee for the night - returning officer Alastair Keddie - explained to the candidates and their election agents how it would be conducted.
Election agents and supporters, proudly wearing their team colours, stalked from table to table where Moray Council staff sat counting votes brought to them from black ballot boxes.
Other workers ran a line from the back of the hall to each table to empty black metal ballot boxes which were arriving from every corner of Moray.
The wood panelled interior of Elgin Town Hall was filled with the sound of murmured voices and the ruffle of paper voting slips between the counters' fingers.
The studious number crunching was only broken briefly when Mr Keddie stepped up on to the stage to announce that refreshments were available upstairs.
Careful counting of votes was carried out at Elgin Town Hall
Unfortunately, this point was far from half-time as the count carried on for another two hours or more.
With the winner seeming to be in little doubt, talk quickly turned to who was going to take second place.
Over the course of the night political heavyweights began to appear in the public balcony above where the count was being conducted.
They included the SNP's Nicola Sturgeon, Labour's Peter Peacock and Lib Dem MP Malcolm Bruce.
At 0035 BST a cheer erupted from the SNP supporters as Mr Lochhead entered the town hall, marking the start of the Nationalist's celebrations even before the result was declared.
But this by-election had more closely resembled a gritty SPL game on a grim Wednesday night, than a glamorous European tie.
Many would argue that there had been a few cynical challenges and alleged fouls committed along the way.
As the final minutes of the count ticked away, supporters of the various parties gathered together in little groups for what appeared to be the beginnings of some post-match analysis.
And when, finally, the results were declared Mr Lochhead stood grinning and giving the thumbs up like a footballer who had helped his team win the league cup.