Tory Alex Fergusson has been elected as the new presiding officer of the Scottish Parliament.
The Galloway and Upper Nithsdale MSP saw off a last-minute challenge from Independent MSP Margo MacDonald.
MSPs voted in a secret ballot to see in Mr Fergusson by 108 votes over Ms MacDonald, who received 20 votes.
Labour MSP Trish Godman was re-elected as one of the two deputy presiding officers, while the SNP's Alasdair Morgan won the other post.
Mr Fergusson had earlier ruled himself out of the politically neutral position of presiding officer, but later said he could do the job while still serving his constituents.
He told parliament: "I will, like my predecessors, reluctantly suspend my party allegiance for as long as I serve in this office.
He added: "Let us all remember that our electorate, the people of Scotland, want this new politics to work for them and we have a duty to deliver what the electorate expects."
The role of presiding officer is likely to become tougher than in previous years as the Nationalists, who have the most MSPs, only have one seat more than the second biggest party, Scottish Labour.
The Scottish party leaders paid tribute to Mr Fergusson.
Current first minister and labour leader Jack McConnell said Mr Fergusson would preside over a "challenging four years" for the Scottish Parliament.
"This parliament reflects in its membership a divided country in terms of its opinions of political parties and politics at this time," said Mr McConnell.
Holyrood's previous presiding officer George Reid told MSPs: "You have just elected a decent and honourable man to head this house."
Margo MacDonald received 20 votes in her bid for the post
Mr Reid said his successor faced "the difficult trick" of sitting impartially on the fence "while keeping his ears pressed firmly to the ground."
"He brings real qualities to that task, a farmer rooted in his native soil, experienced in shepherding his flock in all weathers," Mr Reid said.
In an echo of the 2007 Scottish Parliament elections, there were four spoilt papers due to MSPs voting for more than one candidate in the deputy presiding officer ballot.
Mr Fergusson, in one of his first actions as presiding officer, told MSPs: "I'm quite aware you have all heard that before but can I suggest to members that you only vote for one candidate on the paper."