Alison Johnstone has been elected as the Scottish Parliament's new presiding officer as MSPs returned to Holyrood after the election.
Ms Johnstone was returned as a Scottish Greens MSP for the Lothians last week.
But she will now give up her party affiliation to take over the politically neutral role.
The appointment of the new presiding officer was the first task for the parliament's 129 MSPs after they were formally sworn in on Thursday morning.
Ms Johnstone was the only candidate to put themselves forward for the position - and was backed by 97 MSPs, with 28 voting against her, two others abstaining and one spoiling their ballot paper.
She has been an MSP since 2011 after previously serving as a councillor in Edinburgh.
Ms Johnstone said she was very proud to become the parliament's sixth presiding officer, describing it as a "great opportunity and an incredible privilege which I will never take for granted".
The new presiding officer was a talented athlete who held East of Scotland records in the 800m and 1,500m.
She has worked at the Scottish Parliament since 1999, initially as a staffer for Green MSP Robin Harper, before taking over his Lothians seat from 2011.
The presiding officer role, which is similar to the Speaker in the House of Commons, was filled by Ken Macintosh in the last parliament, but he stood down as a Labour MSP ahead of the election.
This is the first time a Green MSP has been elected to the most prestigious job in Scottish politics outside government.
Some at Holyrood think that's particularly appropriate in the year Glasgow is due to host the COP26 climate summit.
But as parliament's impartial referee, Ms Johnstone has to give up her party affiliation - which is why some in the Greens did not want her to stand.
In fact, no party in this finely balanced parliament wanted to give up a member to the political neutrality of the chair.
Ms Johnstone was persuaded to become the sole nominee for the £113,000-a-year job in the absence of any other candidates.
Her election from the ranks of the opposition means Holyrood is now tied 64 votes to 64 between government and opposition - but the SNP will still need help from other parties to pass budgets and other bills.
No party has been keen to give up one of its members to replace him - but Ms Johnstone was persuaded to stand following cross-party talks.
Giving up one of their MSPS would have left the SNP two seats short of a majority rather than just one.
Ms Johnstone's appointment leaves Holyrood down the middle with 64 SNP MSPs and 64 opposition MSPs.
But there is still a pro-independence majority, with a total of 71 SNP and Scottish Greens MSPs.
Last week's election, which saw the SNP win a landslide victory, means there are 43 new faces among the 129 MSPs in the Scottish Parliament.
And the parliament also has its first permanent wheelchair user to be elected as an MSP, Labour's Pam Duncan-Glancy.
It is expected that SNP leader Nicola Sturgeon will be formally elected as first minister on Tuesday of next week, and that she will unveil her new ministerial team two days later.
Thursday morning's swearing-in ceremony saw all 129 MSPs take either an oath or affirmation that both include pledging allegiance to the Queen.
The oath says: "I do swear that I will be faithful and bear true allegiance to Her Majesty Queen Elizabeth, her heirs and successors, according to law. So help me God".
The affirmation omits any religious reference, and instead states: "I do solemnly, sincerely and truly declare and affirm that I will be faithful and bear true allegiance to Her Majesty Queen Elizabeth, her heirs and successors, according to law."
As in previous previous years, some members chose to give their oath or affirmation in languages other than English.
These included Gaelic, Scots, Doric and Orcadian as well as languages from outside of Scotland - with new SNP MSP Angus Robertson doing his in German, his colleague Humza Yousaf in Urdu, and Scottish Greens MSP Maggie Chapman in Zimbabwean Shona.
The new member for Banffshire and Buchan Coast, the SNP's Karen Adam, made her affirmation in sign language.
Ms Sturgeon was sworn in first, as leader of the largest party, followed by the other four party leaders and finally the remaining MSPs.
Scottish Greens co-leader Patrick Harvie said that his allegiance was to the "people of Scotland" ahead of making his affirmation.