He was elected by 57.56 per cent of all votes – but won the backing of 61.21 per cent of members, with his leadership rival, Monica Lennon, gaining just 38.75 per cent.
However Ms Lennon nosed slightly ahead in the votes from the party’s affiliated members, including trade union members, with 50.64 per cent compared to 49.31 per cent.
The leadership campaign, which was shortened as a result of the forthcoming Holyrood elections, was launched after the unexpected resignation of Richard Leonard who had defeated Mr Sarwar for the position in 2017.
Mr Anas said the party, which has now had ten leaders since devolution, would “focus on what unites our country – not what divides it” and said Labour had “not been good enough” to win the trust of voters.
An MSP for Glasgow, Mr Sarwar has previously been deputy leader of Scottish Labour and also served as an MP until he lost his seat in 2015.
He said the fact he was the first Muslim party leader “doesn’t say something about me. That says something great about Scotland and its people.
“But the fight for equality is far from over. And I’ll work with all our diverse communities in Scotland to rebuild the country we love.”
He added: “I want to say directly to the people of Scotland, I know Labour has a lot of work to do to win back your trust. Because if we’re brutally honest, you haven’t had the Scottish Labour Party you deserve.
“With rising injustice, inequality and division, I’m sorry we haven’t been good enough. And I will work day and night to change that, so we can build the country we all need.”
Ms Lennon congratulated Mr Sarwar, and said she was “proud to have been part of this positive leadership debate.”
UK Labour leader Keir Starmer said he looked forward to working with Mr Sarwar “to secure our economy, protect our NHS and rebuild our country. We will fight the Scottish Parliamentary elections by making the case for a socially just Scotland in a modern United Kingdom. Under his leadership, Scottish Labour will focus on what unites us – not what divides us.
“I know Anas will do the hard work that is necessary to win back the trust of the Scottish people and build for the future as we emerge from this pandemic."
Previous leader Richard Leonard said Mr Sarwar had “a clear mandate from the membership to lead the party. We must all get behind him. Solidarity.”
Mr Sarwar was also congratulated by SNP Justice Secretary Humza Yousaf on Twitter: “This makes him first Muslim & Person of Colour leading a political party in UK, an incredible & historic achievement of which I am proud of him for. Well done Anas.”
However Mr Anas was immediately challenged by opposition parties on his position of a second independence referendum. He has said no vote on independence should be held for at least the next five years while Scotland recovers from the Covid pandemic.
SNP deputy leader Keith Brown said Mr Sarwar had an “impossible job” to “breathe life into a party with no new ideas, ambition or vision for Scotland" and added: “As long as Labour’s dismissive attitude towards independence – and towards Scotland’s right to decide its own future – continues, they have no chance of rejuvenating a party which has already lost nearly all credibility in the eyes of the Scottish people.”
And Scottish Greens co-leader Patrick Harvie said Mr Sarwar faces “a divided party” over the issue, as his rival Ms Lennon had said if pro-independence parties win the Holyrood elections Boris Johnson should not stand in the way of a second referendum.
He added: “Anas has been clear that Scottish Labour would stand in the way of Scots having a say over their future, but this will not play well with around a third of Labour voters who now say they would back independence."
But Scottish Liberal Democrat leader Willie Rennie said he would work with Mr Sarwar on a federalist project.
"Liberal Democrats have long championed a federal future for the United Kingdom and in recent times there has been an increased recognition from Gordon Brown and others that the governing architecture that underpins the United Kingdom needs reform. I am keen to work with Anas and his party to make reform of the UK a reality. It is time to fix the foundations on which our house of nations sits.”