Ken Macintosh has become Labour’s first ever presiding officer at Holyrood.
In a contest billed as being too close to call, he resoundingly defeated his rivals, including Tory veteran Murdo Fraser and former Labour leader Joann Lamont.
Former deputy presiding officer Elaine Smith was removed after the first round of voting, followed by another former deputy, John Scott, leaving the path clear for Mr Macintosh to secure the required majority.
The election of the former Labour leadership contender is the first time Kezia Dugdale’s party has ever held the Scottish Parliament’s most important office.
The role – which Mr Macintosh takes over from Tricia Marwick – is politically neutral with responsibilities including chairing sessions of parliament in Holyrood’s debating chamber and representing the parliament at home and abroad.
Mr Macintosh said it was an “honour and a privilege” to be elected to the role.
He thanked his fellow candidates and paid tribute to Ms Marwick, adding that she should be proud of her achievements in parliament.
Addressing the chamber, he added: “It gives me great pleasure to welcome and thank all of you, the class of 2016.
“I can see around me many familiar faces and friends and I welcome you back, but I see too a huge number of new members, freshly elected.
“The energy, the infectious enthusiasm and the optimism with which you have filled this building already in the few days which you have been here has invigorated me.
“It has refreshed this place and reminded us all of the opportunity the Scottish Parliament offers all of us to make a better Scotland.”
Political leaders have welcomed the appointment.
Scottish Labour Leader Ms Dugdale said: “I am delighted that Ken Macintosh has been elected presiding officer.
“As someone who was elected in 1999, Ken has the experience and skill to guide us through a parliamentary session that will be dominated by cross-party co-operation.”
Scottish Liberal Democrat leader Willie Rennie added: “Ken has big shoes to fill after the progress that was made with Tricia Marwick in the chair but I am sure that he will approach the job with the same energy and fair-mindedness that he has shown as an MSP.”