The SNP’s majority on Dundee City Council was restored on Thursday night when Steven Rome was returned as the new councillor for the North East ward.
Mr Rome, 32, won the by-election called after the death of Labour councillor Brian Gordon in February.
On a turnout of 28.4%, he received 1,507 first preference votes, just shy of the 1,608 to be elected after the first round of counting.
The election used the Single Transferable Vote system, which then counts the second choices of voters to find a winner.
Mr Rome was elected after the sixth stage of counting.
His victory means Dundee City Council is the only local authority in Scotland where one party has an overall majority.
— Nicola Sturgeon (@NicolaSturgeon) May 3, 2019
Scottish Labour candidate Jim Malone received the second highest number of first preference votes, 1,224.
After the result was announced shortly before midnight Mr Rome said: “I am absolutely thrilled and honoured to be elected by the people of the North East ward.
“I want to hit the ground running and learn from my colleagues.
“It is not the best circumstances to win a by-election but we campaigned hard.”
SNP administration leader John Alexander said he was delighted to once again have a working majority.
SNP leader Nicola Sturgeon has also sent “huge congratulations” to Mr Rome.
After the 2017 local government elections the party had just 14 councillors and relied on the support of Lord Provost Ian Borthwick, an independent, to form an administration.
Mr Alexander said Mr Borthwick will continue as Lord Provost and intends to work with opposition parties as much as possible.
He said: “We’ve got a fantastic working relationship with the Lord Provost and I don’t see any reason that will change.”
Roger Keech, Citizens First – 45 First preference votes
Robert Lindsay, Scottish Conservatives – 271
Jim Malone, Scottish Labour – 1,224
Alison Orr, Scottish Green Party – 77
Steven Rome, SNP – 1,507
Michael Taylor, Scottish Anti Cuts Coalition 91