Humza Yousaf narrowly beat his Highland challenger Kate Forbes as the vote to become SNP leader and next first minister went down to the wire.
Mr Yousaf secured 52% of the final vote in the run-off against Ms Forbes, while outside challenger Ash Regan was soundly defeated with just over 11% in the first round.
He will be confirmed as first minister this week, becoming the country’s first Scottish Government leader from an ethnic minority background.
‘Luckiest man in the world’
Mr Yousaf said: “It is hard for me to find the words to describe just how honoured I am to be entrusted by our membership of the SNP to be the party’s next leader.”
He paid tribute to the two candidates who ran against him in the leadership contest and signalled his intent to heal wounds within his party.
The new SNP leader added: “I feel like the luckiest man in the world.”
The outgoing health secretary has been a close ally of Ms Sturgeon and pitched himself as the continuity candidate who can carry forward her legacy.
After the result, Ms Forbes congratulated her rival – weeks after condemning his own record in government.
“I’ve been proud to share a platform with both him and Ash over the last five weeks, and I know we will continue to work together, to make the lives of all of Scotland’s people better on the next stage of our journey to independence,” she said.
“Whatever the robust disagreements or frank exchanges of the last few weeks, I am confident we will unite behind Humza as our new party leader in the shared and common objective of independence.”
Ms Forbes is MSP for Skye, Lochaber and Badenoch. She was on maternity leave when she decided to enter the race for the top job.
Douglas Ross makes things personal
Scottish Tory leader Douglas Ross, a Highlands and Islands MSP, said Mr Yousaf had let people down in his role as health secretary.
Mr Ross, who is also Moray MP, made things personal by referring to his own struggles to access care at Dr Gray’s hospital in Elgin.
“As health secretary, he has been in charge while maternity services at Dr Gray’s continue to be downgraded, which has directly impacted myself and my family,” he said.
He demanded rural communities are given more focus and called for a commitment to dual the A96 Inverness-Aberdeen road, as long promised by the SNP.
Far North Lib Dem MP Jamie Stone echoed Mr Ross in calling for better healthcare in his rural region.
Women based in Wick have to make a more-than-200-mile roundtrip to access some specialised healthcare, he says.
The Scottish Green party immediately endorsed its deal with the SNP to work together in government. The party has questioned whether the government should proceed with major infrastructure commitments like fully dualling trunk roads.
READ MORE: What is the SNP-Green coalition about?
Greens co-leader Patrick Harvie said: “We congratulate Humza Yousaf on his election and look forward to building on the successes of the last 18 months.”
How Humza Yousaf got to the finishing line
Mr Yousaf first entered Holyrood in 2011. Before managing the NHS, he served as justice secretary and transport minister.
Aged 37, Mr Yousaf will become the youngest of Scotland’s six first ministers once he is sworn into the top job.
The new SNP leader became an early frontrunner to replace Ms Sturgeon after Ms Forbes admitted she would have voted against gay marriage.
Mr Yousaf’s campaign was given a further boost when he secured the backing of key party figures such as Perthshire’s John Swinney and Dundee-born Westminster chief Stephen Flynn.
However, he came in for criticism from Ms Forbes over his performance in government during an explosive televised debate which exposed major rifts in the SNP.
Tory and Labour rivals branded Mr Yousaf unfit to become first minister and he will face a huge task proving he is up to the top post.
Just over 50,000 of the SNP’s members in total voted in the leadership contest.
Conversation