Four years ago, as Alex Salmond took one of the world’s oldest political unions to the brink, his own alliance with Nicola Sturgeon seemed unshakable.

On Thursday night, it emerged that the Former first minister was taking Sturgeon’s government, the one he used to lead, to court.

Whatever the outcome of that legal bid, and of the two allegations of sexual misconduct made against him, the events of the past two days confirm the final bend in the arc of Salmond’s career.

The charismatic former economist always captivated the SNP, but began his political life as maverick outsider, briefly expelled by the party leadership as a ringleader of the upstart left-wing ‘79 Group’.

Salmond was elected to Westminster in 1987, taking charge of the SNP in 1990 and entering the Scottish Parliament in 1999. But his unforgiving rhetorical approach with opponents bespoke difficult working relationships inside the party. He resigned from the SNP leadership and the Scottish Parliament in 2001 and enjoyed national profile at Westminster.

With the SNP at low ebb, Salmond made an emphatic return in 2004, winning three-quarters of the vote in a leadership ballot with Sturgeon as his deputy – a partnership that lasted a decade.

His sunnier public persona and gradualist approach to independence brought two election victories for the SNP, making an independence referendum all but inevitable.

By the the time Salmond resigned following defeat in that referendum, there was no question of anyone but Sturgeon succeeding him. However, once the pressure of leadership was on her shoulders, while he had again swapped Holyrood for Westminster, a gap began to open between them.

In the months following the EU referendum, he added to pressure on the First Minister for a new vote on Scottish independence, ultimately contributing to the loss of his own seat at Westminster in 2017.

Since being left without elected office for the first time in 30 years, his full-time return to maverick outsider status has also strained his relationship with the half of the SNP that prefers Sturgeon’s style to Salmond’s.

He has faced controversy for hosting a programme on the Russian state-backed television channel, Russia Today, since November, and his refusal to give it up following the Salisbury nerve agent attack further alienated critics inside the SNP.

However, many if not most nationalists remain loyal and venerate Salmond as a national hero, a feeling reflected in some of the commentary on social media yesterday.

Despite appeals from the very top of the SNP to let due process take its course, there was disbelief mixed with anger: Gavin Barrie, an Edinburgh councillor who left the SNP earlier this year posted on “Something doesn’t smell right here, not at all. If Alex Salmond has done anything wrong, I’ll apologise fully, but this absolutely stinks.” That message has resonated with some current elected SNP figures, but appalled others.

Earlier this year, the former First Minister announced his intention to return to frontline politics, and has been rumoured to be seeking a Westminster seat in the northeast of Scotland. As at the start of his career, however, Salmond no longer has the power to unite his party – only to divide it.