Humza Yousaf's role as First Minister was in peril even before he was sworn in.

The result of the SNP leader contest ensured he was always looking over his shoulder.

During the contest, Kate Forbes's savage attack on his ministerial record shattered the perception the SNP was a united and self-disciplined party.

Having won the contest by 52% to 48% over Kate Forbes he was never going to command the authority enjoyed by both Nicola Sturgeon and Alex Salmond.

READ NEXT:John Swinney said he will consider standing for SNP leader

And soon both would cause him major problems preventing him from stamping his own identity and style on the Scottish Government.

The arrest of first, Peter Murrell, then Nicola Sturgeon, in the investigation into party finances, ensured the focus remained on his immediate predecessor and cast serious doubt on the integrity of the party he had just taken over.

Glasgow Times:

Ash Regan, his other rival for the leadership, resigning and moving to Alba, under Alex Salmond’s leadership, showed he had not gone away and still considered himself a major player in the independence movement.

On top of this, he had to deal with the Israel-Gaza crisis in a way not expected of a Scottish first minister.

His wife's parents were trapped in Gaza as the ferocity of Israel's retaliation for the Hamas terror attack became clear.

READ NEXT: Humza Yousaf: From call centre worker to First Minister

Her brother was also living and working as a doctor in the main hospital.

He endured a family crisis while carrying out his job as first minister and his criticism of Israel for its response was forthright and passionate and won him respect among many particularly pro-Palestine campaigners.

Glasgow Times:

But ultimately it was another Nicola Sturgeon legacy that led to his downfall.

Sturgeon had entered into the Bute House Agreement with the Scottish Greens having narrowly fallen short of winning an outright majority of MSPs.

It gave her, and also Yousaf, the security of a majority in the Holyrood chamber on key votes and provided an independence-supporting majority government.

But the narrowness of Yousaf's leadership win and the contest with Forbes and Regan had opened up division and opposition to the deal from the right of the SNP.

READ NEXT:Humza Yousaf: My family ease stress of being First Minister

While Sturgeon was seemingly able to manage that, it became a burden for Yousaf.

He found himself stuck between the socially conservative side of the SNP and the Greens on issues like gender self-identification.

His decision to end an agreement he had previously defended vigorously sparked the leadership crisis which ended with his resignation statement.

Alex Salmond had seven years as First Minister, Nicola Sturgeon almost nine.

Both enjoyed success with the party on the up, a period of almost guaranteed electoral success and rising membership.

Humza Yousaf took over amid looming turmoil and electoral uncertainty.

Some will say he was not a strong enough character or experienced enough politician to manage a major party and lead a government and, in the end, his naivety cost him.

Others, being kind, could say the odds were against him from the start.