Scottish Labour leader Iain Gray will stand down in the autumn after a disastrous night for his party in the Holyrood election.
Labour made the announcement after the SNP won a majority of seats in the Scottish Parliament - the first time a party has achieved such a presence in the chamber.
Mr Gray only held on to his East Lothian constituency by 151 votes over SNP candidate David Berry, prompting calls for a recount.
Mr Gray said election night was "dreadful" for Labour and promised to take time to assess what happened before standing down.
Speaking to BBC Scotland, he said: "It was a dreadful night and I acknowledge that, the Labour Party has to accept that.
"The electorate have certainly spoken and given a very clear result.
"There are some very hard and fundamental lessons for the Scottish Labour Party, not least about my own responsibility in the role as leader of Labour in the Scottish Parliament.
"It is my view that we have to address some very fundamental questions about the structures and organisations of the Labour Party in Scotland.
"I want to start that process off but in the autumn I will stand down and it will be for the Labour Party to decide how we go forward from there."
Mr Gray also said he would like to offer SNP leader Alex Salmond his "unstinting congratulations" for an "absolutely remarkable achievement".
Mr Gray said he discussed the party's election collapse with Labour hierarchy in London.
He added: "I have spoken with Ed Miliband and we have agreed that we need a fundamental root and branch review of the Labour Party in Scotland and that will now happen.
"Scottish politics changed significantly last night and in essence we went from a four party system to something more like a two party system.
"The Labour Party was very much second best.
"We need to take some time in the Labour Party to consider what happened, to consider what we have to do to recognise the changed political circumstances and decide how we move forward."
Mr Gray said he accepted responsibility for the result.
He said: "We could have done better and I do accept responsibility but I think there is more happened last night than the failure of my leadership
"I think there are many different factors at play here, some very profound, some very significant.
"Therefore, I do think that a root and branch review of the way we organise our political strategy is very much what is required.
"Having taken responsibility for the campaign and the result, I think it is right I take responsibility for ensuring that process takes place."
Mr Gray had previously said he would take "responsibility" for Labour's poor result and refused to be drawn on his future as leader.
Speaking after his constituency count in Haddington this morning, he said: "I am the elected leader of the Scottish Labour Party, and that gives me the responsibility - the responsibility to lead, looking at the campaign, analysing what's happened, and deciding how the party goes forward.
"That's a responsibility that I intend to undertake."
Labour's deputy leader, Johann Lamont, said Mr Gray had been a victim of a "vitriolic" campaign against him.
She praised his "integrity" and added that the party was proud of him.
She said: "He was the victim of a vitriolic campaign against him. There were relentless attacks on our leader.
"He is a man of great integrity, principle and intellect, who throughout this campaign told people how the Scottish Parliament can protect them."
Labour had a mixed election campaign, gaining support from a host of celebrity and high-profile figures such as comedian Eddie Izzard and Manchester United manager Sir Alex Ferguson.
However, Mr Gray came in for criticism after failing to speak to anti-cuts protesters on a campaign trip to Glasgow.
Mr Gray took refuge in a Subway sandwich shop after an encounter with protest group Citizens United Against Cuts to Public Services.
Mr Gray later dismissed the interruption.
Speaking afterwards, he said: "I've walked the killing fields of Cambodia and I was in Chile three days after Pinochet demitted office.
"I've been a lot of places, seen a lot of things - that certainly wasn't the worst of them."Reuse content