Former Holyrood minister Iain Gray has been elected the new leader of the Scottish Labour party, it was announced.
The result of the ballot triggered by Wendy Alexander's resignation in June was announced at the party's Glasgow headquarters.
Mr Gray, who served as enterprise minister in Labour's first Scottish administration, defeated rival candidates Cathy Jamieson and Andy Kerr.
The contest also saw MSP Johann Lamont defeat fellow MSP Bill Butler by 60.18% to 39.82% in the battle for the deputy leadership.
In the fight for the leadership, no candidate achieved 50% of the votes in the first round.
The lowest rating candidate, Andy Kerr, was eliminated at that point and his supporters preferential votes were then redistributed to the two remaining candidates, Mr Gray and former Justice Minister Cathy Jamieson. That gave Mr Gray victory by a margin of 57.79% to 42.21%.
By a quirk of coincidence both candidates for the deputy leadership are former English teachers, and Johann Lamont was able, in her victory speech, to note that even when there were policy divisions these had been expressed grammatically.
In his victory speech, Mr Gray declared: "This election is the beginning of a new direction for Scottish Labour, united around our shared values and moving forward with a common purpose."
He said that although it was sometimes argued that Labour had ruled in Scotland for 50 years, he had joined the party in Edinburgh at a time when the city had been ruled by Tories for "centuries" and at the start of 18 years of Tory rule in Scotland.
"But we won that council and we won that country and we did it by uniting around our values, by standing shoulder to shoulder - MPs, councillors, trade unions, party members."