LABOUR have hung on as the administration of Edinburgh City Council despite a scandal which saw their leader resign.
Unionist parties in the capital teamed up to support the Labour administration continuing, with Jane Meagher set to become council leader.
A proposal for an SNP/Green administration was defeated by 32 votes to 28.
Labour will remain as the minority administration propped up by the Tories and LibDems.
Meagher has until now been convener of housing, homelessness and fair work. In the last few days, Shelter Scotland called for the Scottish Government to step in and remove the council leadership in a dispute over its use of unlicensed houses in multiple occupation.
The Tory group put forward a bid to continue the matter into the new year, but this was overwhelmingly opposed and they then backed the Labour bid for leadership.
The Labour minority administration had seemed like it was on the ropes after ex-leader Cammy Day was suspended from the party amid allegations he sent sexual messages to Ukrainian refugees.
It meant they were leading the council with just 10 elected members in the chamber, something which was described by the opposition as "unacceptable".
But it has now been decided there will be no change in the city despite some Labour members indicating a difficult few weeks had left them "conflicted" on the way forward.
The SNP and Greens had put forward a bid to lead the council and give it a "fresh start" with SNP group leader Simita Kumar proposed as council leader, but they did not manage to garner enough support from across the chamber to succeed.
New council leader Meagher – who dialled into the meeting from Tanzania – was, on more than one occasion, criticised for not opting to speak until the very last minute in the debate, when she said she wanted to build consensus for her aims of eradicating poverty in the city and reaching net zero by 2030.
Day dialled in virtually while keeping his camera off in order to vote. At one stage, it was requested he turn his camera on for the vote but it was set out by the Lord Provost there were no rules requiring him to do this.
In her speech before the vote, Kumar said Labour could not be allowed to continue leading a "fractured" administration, adding the last few weeks had been a "living nightmare" for the local authority.
She said: " If Labour are voted in, this will continue and spell further uncertainty for the city we love.
"No one wishes to take over an administration halfway through a term, nobody. But we have recognised as the largest group we have the responsibility to do so.
"I urge you to vote to take us all away from this living nightmare."
Early on in the meeting, deputy council leader Mandy Watt was asked to explain when the Labour group first knew of the allegations Day was facing.
She said she first found out at a Christmas party in the City Chambers on December 6.
"I first became aware there was a serious issue on December 6," Watt said.
"There were Christmas parties here in the chambers. I was looking forward to an enjoyable night.
"At one point, maybe about 8.30pm or 9pm, Councillor[Chas] Booth [Green] put his smartphone to me and said 'have you seen this headline in The Times?'.
"I was absolutely stunned, had no idea what it was about.
"As soon as I got home I had to subscribe to The Times. Prior to that I had no knowledge about these specific things."
Elsewhere, Labour councillor Katrina Faccenda abstained from the vote after she blasted her group accusing them of "turning a blind eye to dishonesty".
In the new year, the council will hold a key vote on putting in place a visitor levy in the city before voting on a budget for the coming year.