Media playback is unsupported on your device Media caption "We have tonight made history" - SNP's Nicola Sturgeon

SNP leader Nicola Sturgeon has downplayed talk of another independence referendum after winning the party's third election victory in a row.

Confirming she would form a minority government at Holyrood, she said her aim was to "persuade, not to divide".

Despite Labour coming third in Scotland, Jeremy Corbyn insisted the party had "hung on" and done better than expected in Wales and England.

Sadiq Khan leads the London Mayoral election as counting continues.

With all the results declared in Scotland, the SNP is the largest party with 63 seats, ahead of the Conservatives on 31 and Labour on 24.

Labour remains the dominant party in Wales, winning 29 out of 60 seats, but falling just short of a majority. Plaid Cymru pipped the Tories to be the second largest party in the Welsh Assembly while UKIP won seven seats on a good night for the party.

Counting continues across English councils but the BBC is forecasting that, on the basis of the results so far, Labour would have got a 31% projected share of the national vote, with the Conservatives on 30%, the Lib Dems on 15% and UKIP on 12%.

Media playback is unsupported on your device Media caption Jeremy Corbyn said Labour "hung on" and "grew support in a lot of places” across England.

Elections expert John Curtice said the result - calculated on the basis the UK electorate as a whole had behaved in the same way as voters did in the English local elections - was slightly better than Labour might have expected.

In the London Mayoral race, a live update of the vote tally shows Labour candidate Sadiq Khan currently ahead of his Conservative rival Zac Goldsmith. In Northern Ireland, the first results for the assembly election are being declared with the final result due on Saturday.

Tap here to search for election results in your area.

Speaking in Edinburgh, Ms Sturgeon said that despite falling two seats short of a majority, the SNP had secured an "emphatic" victory and had a "clear and unequivocal" mandate.

She said the party would govern on its own rather than in alliance with other parties. On the issue of a future vote on independence, she said the SNP will make "our case with passion, with patience but will always respect the opinion of the people".

But Scottish Conservative leader Ruth Davidson said any prospect of the issue being reopened in the next five years had been "utterly shredded" by the SNP's failure to win a majority.

Analysis by Laura Kuenssberg, BBC political editor

Jeremy Corbyn's party has swerved universal disaster - losses so far in England are fewer than some had feared. But with meltdown in Scotland, and losses where there should traditionally be gains, Labour would be foolish to take much comfort from the results.

There is little to suggest that voters believe the Labour Party on its current performance is on its way to a general election victory. Mr Corbyn's internal enemies are not likely to wield the knife, but there are already calls for more decisive leadership, more appeals to go to the centre ground.

But nor is there much evidence of enthusiasm for the Conservative government in England. The Tories so far have picked up a handful of seats, traditionally an achievement for a party in power at these kinds of polls.

But for success, and unexpected success, the Conservatives can look to Scotland where it appears they are set to take second place, - a fundamental change in Scotland. But there, voters again expressed their faith and belief in the Scottish National Party as their government.

Read more from Laura

In the English council elections, BBC analysis suggests the Tory vote fell in southern England, which may have helped Labour to retain control of councils in areas such as Crawley, Southampton, Norwich and Hastings, where its vote was looking vulnerable.

Labour's vote share is down about 6% on average on 2012 - the last time these seats in England were contested - with 24 fewer councillors. But a BBC analysis suggests its share is up 4% on the general election in key wards, with the Conservatives down by a similar amount.

Its share was more sharply down in Scotland. The party gained one seat from the SNP - Edinburgh Southern - but failed to take other targets and was beaten into third place by the Conservatives - a result that would have been unthinkable in the past.

Labour also lost its Rhondda Welsh Assembly seat, in its south Wales heartlands, to Plaid Cymru leader Leanne Wood.

In other developments:

Brighter news for Labour came with it holding the seat of Sheffield Brightside in a Westminster by-election, with UKIP coming second. The party also held Ogmore in another Parliamentary by-election, in South Wales, with UKIP again in second place.

Speaking in Sheffield, Mr Corbyn said it had "grown support" in parts of England but he acknowledged the scale of the defeat in Scotland, saying there was a "lot of building" to do.

Amid speculation about Mr Corbyn's future, his deputy Tom Watson said he needed "more time" to show he could revive Labour fortunes.

But MP Michael Dugher said Labour was "not on a trajectory" to victory in 2020 while shadow scottish secretary Ian Murray suggested the public did not see Labour "at the moment as being a credible party of future government".

Media playback is unsupported on your device Media caption The BBC's Laura Kuenssberg confronts Shadow Chancellor John McDonnell with Labour's election memo

Media playback is unsupported on your device Media caption Gill Furniss, widow of Harry Harpham, wins Sheffield seat

For the Conservatives, the highlights of the evening were in Scotland, winning the Holyrood seat of Eastwood from Labour and Ruth Davidson's winning Edinburgh Central from the SNP.

David Cameron said the party's second place in Scotland and its showing in England, where it took control of Peterborough Council and won council seats in key Westminster marginals such as Dudley and Nuneaton, represented a good result for a party in government for six years.

"Local election day for sitting prime ministers is supposed to be a day of dread, waiting for the knock on the door like a condemned man waiting for a hangman," he said. "But that's wasn't what it was like last night."

Plaid and UKIP gains

In a surprise result in Wales, Plaid Cymru leader Leanne Wood unseated Labour's Leighton Andrews in the Rhondda - described by former Labour cabinet minister Peter Hain as "a terrible shock for us in Welsh Labour".

Ms Wood said: "A new dawn has already broken over the Valleys, people have voted for change."

In Wales, Labour's vote is down by eight points overall, the Conservative vote is down by three points, while Plaid Cymru is up by two points.

The big story of the night in Wales was the performance of UKIP, which saw its vote increase by 12 points. The party's leader Nigel Farage hailed it as a significant breakthrough.

Image copyright PA Image caption Labour has held several councils in England it was thought it might lose

Image copyright PA Image caption UKIP were celebrating winning a seat in Basildon

In total, 2,747 seats in English councils - spanning metropolitan boroughs, unitary authorities and district councils - were up for grabs. The majority of the seats were last contested in 2012.

Thursday's polls were the single largest test of political opinion before the next general election, which is scheduled for 2020, with 43 million people entitled to take part.

What's still to come (all timings are estimates)

Friday 6 May

11:30 onwards: Forty four councils in England declaring on Friday

15:00: First results of London Assembly elections

17:00: First preference vote share information for elections to Northern Ireland Assembly

1800: Result of first preference votes for Mayor of London (final result expected early evening)

Results of Police and Crime Commissioner elections in England and Salford mayoral contest are also expected on Friday.

Saturday 7 May

14:00 Results from five remaining councils in England

16:00 Result of Bristol Mayoral contest

Result of elections to Northern Ireland Assembly expected

Sunday 8 May

16:00 Result of elections to Bristol Council (final council in England to declare)

Results of Police and Crime Commissioner elections in Wales