Scottish National Party (SNP) veteran John Swinney was elected as its new leader on Monday and is set to replace Humza Yousaf as Scotland‘s first minister after he emerged as the sole contender in the contest to pick a new premier.

Swinney’s key challenge will be to halt the slide in the SNP’s popularity after a string of scandals and political missteps, while keeping alive its ultimate goal of winning independence from the United Kingdom.

“My decision to stand for the leadership is not born out of long-held ambition, but rather a profound sense of duty to my party and to my country,” Swinney, who joined the party as a teenager in 1979, told a cheering audience in Glasgow.

“I know there’s some controversy that I’m the only candidate to stand for the leadership….For me, the fact that I am the only candidate demonstrates that the Scottish National Party is coming back together again now.”

Yousaf, who had become the first Muslim to lead a democratic western European nation when he was sworn in as first minister in 2023, resigned last week after his decision to end a coalition in the Scottish parliament with the Green Party backfired, triggering a race to determine his successor.

Shortly after midday on Monday, the deadline for other contenders to join the contest, the SNP confirmed Swinney as its next leader, ending uncertainty around a possible weeks-long process that would have ensued if there were more candidates.

Former finance minister Kate Forbes, who narrowly lost a leadership contest to Yousaf when Nicola Sturgeon resigned as leader last year, was expected to run but ruled herself out on Thursday.

Forbes had said she and Swinney shared a “common purpose”.

Over the weekend, there were also reports that party activist Graeme McCormick was hoping to challenge Swinney for the leadership, but Sky News reported late on Sunday that he had decided not to proceed with his nomination, citing a statement from him.

That left Swinney, who was SNP leader from 2000-2004 and had also served as Scotland‘s deputy first minister and finance minister, as the sole nominee in the contest.

The SNP has dominated Scottish politics for 17 years but its popularity has slipped over the past year amid a funding scandal, a series of political blunders, and criticism of how it runs the country. It now heads a minority government in Holyrood.

The slide has boosted the hopes of Britain’s opposition Labour Party of regaining ground in Scotland, one of the United Kingdom’s four nations, as it seeks to win a British parliamentary election expected later this year.

The SNP aims to reinvigorate the push for another referendum on independence from the United Kingdom.

Scots voted against splitting from the United Kingdom by 55% against 45% in a referendum in 2014, but the independence movement says Britain’s later departure from the European Union changed the situation and another referendum is justified – a claim that both the ruling Conservative Party and Labour reject.