LONDON: Scottish nationalists won a third term in power but lost their outright majority on Friday in one of a series of local and regional elections seen as a key test for Labour leader Jeremy Corbyn.

Britain’s main opposition Labour Party came third in the vote for Scotland’s devolved Parliament.

The race to replace Conservative Mayor Boris Johnson was marred by American-style negative campaigning and allegations of extremism and fear-mongering.

The elections demonstrated the complexity of British politics in the final weeks before Britons vote in a critical referendum on whether the country should remain in the European Union. The strength of opposition leader Jeremy Corbyn is particularly under scrutiny, as the races were the first nationwide poll since he took over as leader.

The pro-independence Scottish National Party secured a third term in government in the county’s parliamentary elections. They failed to secure a majority by only two seats. SNP Party Leader Nicola Sturgeon told jubilant supporters that the voters showed trust in the party.

“The SNP has won a third consecutive Scottish Parliament election,” she said. “That has never been done before in the history of the Scottish Parliament. We have tonight made history.”

While Labour’s losses in Scotland were humiliating, the party fared less badly overall than predicted. It held on to major cities in England, including Birmingham, Newcastle-upon-Tyne and Sunderland.

Corbyn acknowledged that the party had “a lot of building to do” in Scotland, but was pleased with results in England.

“We hung on and we grew support in a lot of places,” he said.

The results will do little to quell restive Labour lawmakers who think Corbyn’s left-wing policies are a turn-off for many voters.

Leftwinger Corbyn, under pressure from centrists in his party since taking power last year, insisted his party had “hung on” and surpassed expectations.

“All across England last night we were getting predictions that we were going to lose councils. We didn’t,” he said. “We hung on and we grew support in a lot of places.”

While the results may have done enough to damp down talk of a leadership challenge to Corbyn for now, they will not ease disquiet among some MPs about his leadership.

With results from 87 councils in, Labour had 43, down one, and 846 seats, down 22.

Prime Minister David Cameron’s Conservatives had control of an unchanged 23 councils and 520 seats, up seven.

North of the border, Nicola Sturgeon, leader of the pro-independence Scottish National Party (SNP) claimed the result as a major victory as her party seeks a mandate to move toward a second independence referendum.

“What is now beyond doubt is that the SNP has won a third consecutive Scottish Parliament election.” Sturgeon said. “We have tonight made history.”

However, the 63 seats out of 129 won by the SNP fell short of polling ahead of the election which had suggested the party would retain its majority.

The SNP, which previously had 69 seats, will now have to seek the support of a smaller party like the Greens to govern.