Richard Leonard has resigned as Scottish Labour leader, saying it is in the best interests of the party for him to stand down.
Mr Leonard said he believed speculation about his leadership had become a "distraction".
And he said he would be stepping down with immediate effect.
His resignation comes just months ahead of the Scottish Parliament election, which is scheduled to be held in May.
Mr Leonard had been leader of the party for three years after succeeding Kezia Dugdale.
The former union official had faced open calls to quit from some of his own MSPs last year amid concerns that his leadership style could damage the party in the forthcoming Scottish Parliament election.
Polls have suggested that many Scottish Labour supporters struggle to recognise him, and he is closely associated with former UK Labour leader Jeremy Corbyn.
Scottish Labour had dominated politics in Scotland for decades, but is currently the third largest party at Holyrood behind the SNP and Conservatives.
And Mr Leonard's critics had questioned whether he was capable of turning the party's fortunes around.
In a statement, Mr Leonard said the decision to resign had not been easy - but he felt it was the right one for him and his party.
He said: "I have thought long and hard over the Christmas period about what this crisis means, and the approach Scottish Labour takes to help tackle it.
"I have also considered what the speculation about my leadership does to our ability to get Labour's message across. This has become a distraction.
"I have come to the conclusion it is in the best interests of the party that I step aside as leader of Scottish Labour with immediate effect."
He also insisted that Scotland now needs a Labour government more than ever, and accused both the Scottish and UK governments of mishandling the coronavirus pandemic.
Mr Leonard added: "While I step down from the leadership today, the work goes on - and I will play my constructive part as an MSP in winning support for Labour's vision of a better future in a democratic economy and a socialist society."
His decision leaves Scottish Labour looking for its fifth leader since the independence referendum in 2014 - with Johann Lamont, Jim Murphy and Kezia Dugdale all having held the job since then.
A Procedures Committee, to oversee the election of Mr Leonard's successor, has been formed and will have its first meeting on Friday.
Meanwhile, Labour's Scottish Executive Committee will also meet in the coming days to agree a timetable for the process.
MSP Jackie Baillie, who was Scottish Labour's deputy leader, has taken charge of the party on an interim basis.
This sudden resignation four months from the Holyrood elections seems to have taken Scottish Labour by surprise.
MSPs I've spoken to said they did not see it coming.
There have been times when Richard Leonard has been under severe pressure from some in his party to stand down.
When several MSPs publicly called for him to quit because the party had gone backwards at successive elections on his watch, he stood firm.
His critics seemed to have accepted that he would lead them and a divided party into the Holyrood election.
That has now changed and interim leader Jackie Baillie has to quickly organise a contest to replace him.
It's a contest in which Anas Sarwar, if he stands, would be an obvious frontrunner - even although he lost last time to Mr Leonard, who was seen as much closer to the then UK party leader, Jeremy Corbyn.
Labour leader Sir Keir Starmer said Mr Leonard should be "very proud" of his achievements as leader of the party in Scotland.
Sir Keir added: "I would like to thank Richard for his service to our party and his unwavering commitment to the values he believes in.
"Richard has led Scottish Labour through one of the most challenging and difficult periods in our country's history, including a general election and the pandemic."
Looks like those who have led a 3 year campaign of briefings to journalists, leaks of private conversations and the constant feeding of stories to the media to bring down a decent and honest man have succeeded. These flinching cowards and sneering traitors make me sick.— Neil Findlay MSP (@NeilFindlay_MSP) January 14, 2021
Mr Leonard had been due to face a confidence vote at the party's ruling Executive Committee last September - but the motion was withdrawn at the last minute.
It came after four Scottish Labour MSPs called for him to go, warning that the party faced "catastrophe" at the ballot box under his leadership.
They pointed to the party's dismal performance in previous elections under Mr Leonard.
Scottish Labour finished fifth in the European election in May 2019, and then lost all but one of its MPs in the general election in December of the same year.
Mr Leonard insisted at the time that he intended to lead the party into this year's Holyrood election, and accused his opponents of waging "internal war" against him.
'A decent guy'
First Minister Nicola Sturgeon, who faced Mr Leonard in her weekly question session in the Scottish Parliament, tweeted that she had "always liked Richard Leonard" despite their political difference.
She added: "He is a decent guy and I wish him well for the future."
Ruth Davidson, who quit as leader of the Scottish Tories in 2019 before returning to lead the party at Holyrood, said she had always found Mr Leonard to be a "thoroughly decent man and a committed campaigner."
Anas Sarwar, who was defeated by Mr Leonard in the leadership contest in 2017 and is seen as one of the favourites to replace him, said he was sure Mr Leonard would "continue to fight for a fairer, more just and more equal society today, tomorrow and long into the future."
But Labour MSP Neil Findlay, an outspoken supporter of Mr Leonard, took aim at those who had sought to oust him last year - describing them as "flinching cowards" and "sneering traitors".