By Elizabeth Piper and Elisabeth O'Leary

LONDON/EDINBURGH (Reuters) - Britain's main opposition Labour Party lost less ground than expected in local elections on Friday and was leading the race for London's mayor, giving new leader Jeremy Corbyn enough ammunition to brush off his critics.

Labour officials said the party's overall performance - though poor - was strong enough to stop any immediate challenge to Corbyn, who opponents criticize for pressing a leftist agenda that lacks broad appeal.

Labour was forced into third place behind the Conservative Party in Scotland for the first time since the country was granted its own assembly, a crushing blow for a party which counted on it as a traditional stronghold for decades.

It also lost seats in England and Wales, while avoiding the catastrophic defeat some had predicted. There was little change for the ruling Conservatives in England and Wales but a stronger showing for smaller parties, such as the anti-EU UK Independence Party before a referendum on the bloc on June 23.

Corbyn, who was elected as party leader last year on a wave of enthusiasm for change and an end to 'establishment politics' among many, mostly younger, members, welcomed at least some of the results.

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

"Our party is standing up," he said, speaking in the northern city of Sheffield, where Labour won a parliamentary by-election.

Some sources, critical of Corbyn, said it was not the time to move against Corbyn, who still enjoys support from thousands of party members, many of whom joined the party because of him.

But one source, who asked not to be named due to the sensitivity of the situation, described the result as frustrating - a poor showing for a party at a time when the ruling Conservatives were deeply divided over a referendum on British membership of the European Union on June 23.

Story continues

MAYORAL HOPES

Britons voted on Thursday to elect new devolved authorities in Scotland and Wales, more than 2,700 local officials across England and a new mayor of London.

With nearly two-thirds of the results declared, there was little change in England, but Labour lost nine percent of its share of the vote in Scotland and some ground in Wales.

In Scotland, where Labour became the third largest party being beaten by the Conservatives, Anas Sarwar, a newly elected Scottish lawmaker, said the party needed to broaden its appeal.

"I think that the reality is that people aren't listening to us any more ... and we have to earn that right again."

Corbyn may hope that an expected victory for Sadiq Khan in London's mayoral election will help him limit the damage of the results. A Labour victory will be a big prize, loosening the Conservatives hold over Britain's financial center.

But the Labour leader will struggle to quell criticism of his rule in a party which has moved from crisis to crisis, the latest a row over anti-Semitism forcing Corbyn to suspend a veteran ally, Ken Livingstone.

Richard Angell, director of Labour activist group Progress, said the party had to refocus on issues that concern voters.

"Corbyn needs to shake up his operation," he told Reuters.

(Additional reporting by William James, Paul Sandle and Andy Bruce, Writing by Elizabeth Piper; Editing by Jeremy Gaunt)