Humza Yousaf said he felt like the “luckiest man in the world” after being elected as the new SNP leader.

Mr Yousaf, who has been Scottish Health Secretary since 2021, succeeds Nicola Sturgeon in that role, and will now be formally elected by MSPs as Scotland’s sixth first minister on Tuesday.

He recorded a narrow victory over rival Kate Forbes once second preference votes were taken into account when Ash Regan was eliminated from the contest after the first round of voting.

In a speech after his victory was announced, he pledged to “dedicate every waking moment” to serving the people of Scotland.

He will be the first person from an ethnic minority background to be first minister and the first Muslim to lead the country – as well as the youngest ever first minister.

The 37-year old recalled how his grandparents had moved from the Punjab to Scotland more than six decades ago

He said: “As immigrants to this country, who knew barely a word of English, they could not have imagined in their wildest dreams that their grandson would one day be on the cusp of being the next first minister of Scotland.”

The new leader continued: “We should all take pride in the fact that today we have sent a clear message, that your colour of skin, or your faith, is not a barrier to leading the country we all call home.

“From the Punjab to our Parliament, this is a journey over generations that reminds us that we should be celebrating and always celebrate the migrants who contribute so much to our country.”

Mr Yousaf pledged to work to unite the SNP after a “bruising” leadership contest sparked by Ms Sturgeon’s sudden resignation.

Humza Yousaf ran against Ash Regan, left, and Kate Forbes, right, in the leadership contest sparked by Nicola Sturgeon’s resignation (Andrew MIlligan/PA)

He ran for the party leadership against Finance Secretary Kate Forbes, who returned early from maternity leave to stand, and the former community safety minister, Ash Regan.

Mr Yousaf failed to win a majority in the first round of voting, but won 52.1% of the votes after second preference votes from Ms Regan, who came third, were redistributed.

Ms Forbes came second, with 47.9% of votes, when second preferences were included.

Mr Yousaf said serving as first minister would be “the greatest privilege and honour of my life”, telling people across the country: “I will be a First Minister for all of Scotland.”

He told voters he would “work every minute of every day to earn and re-earn your respect and your trust”.

Mr Yousaf continued: “I will do that by treating you, the people of Scotland with respect.

“There will be no empty promises, or easy soundbites when the issues in front of us are difficult and complex, because Government is not easy and I won’t pretend it is.”

He said his “immediate priority” would be dealing with the cost of living crisis, as well working to “recover and reform our NHS and other vital public services”.

But he also pledged to “move quickly” on campaign pledges made to extend childcare, improve rural housing and provide greater support small businesses.

And he stressed he was “determined” to secure independence for Scotland, saying: “Joining the SNP, for me, was an act of hope and also statement of intent.”

Mr Yousaf pledged to “kickstart” a grassroots campaign that would “ensure our drive for independence is in fifth gear”.

The new SNP leader added: “The people of Scotland need independence now more than ever before, and we will be the generation that delivers independence for Scotland.”