Prime Minister Tony Blair sidestepped electoral catastrophe Friday but voters handed the outgoing leader a string of bruising municipal defeats — and his governing Labour was locked in a battle for Scotland with a party promoting independence.

Early results from Thursday's vote suggested Blair — who has said he will formally announce next week he will resign as prime minister, likely by July — averted a predicted routing, but had lost hundreds of seats on local councils.

A tight contest in Scotland, where Labour has won every election for the last 50 years, saw the Scottish National Party — which has pledged a referendum on independence by 2010 if it wins power — gaining ground as officials continued to count ballots.

Around 10,000 local council seats were contested in Thursday's elections in areas of England outside London. In Scotland, voters chose their local representation as well as the Scottish Parliament, which sits in Edinburgh and deals with Scotland-only issues. And in Wales, voters elected their national assembly, located in Cardiff.

Blair has claimed three national poll victories since 1997 — unprecedented for Labour — but some activists concede the unpopular Iraq war and a domestic cash-for-honors scandal have made him an electoral liability.

With results from 133 of 312 English councils counted, Labour lost 168 seats and control of five councils, while the opposition Conservatives gained 318 seats and control of 15 more councils, to a total of 67. The third-place Liberal Democrats lost 97 seats but still gained one council to a total of 10.

"A great set of results and I think we can really build on them and really go forward, and I think that's exciting," Conservative leader David Cameron said Friday morning.

After 52 of 60 Welsh assembly seats were declared, Labour had lost 3 but remained the largest party.

In Scotland, with 81 of 129 parliamentary seats called, Labour had won 32 seats and the Scottish National Party had 31.

Elections officials said they planned an investigation into tens of thousands of spoilt ballot papers recorded in Scotland, fearing people may have been confused by a complex voting system.

"Overall, what we're seeing are the midterm blues," ex-Foreign Secretary Jack Straw, watching ballots being counted in the town of Blackburn, northern England, told British Broadcasting Corp. television. "That's just a fact of life."

He said it was typical for the party in government to fare badly in municipal polls, before "bouncing back at the general election."

Labour's performance was marginally improved on results in 2006 local elections and better than polls had suggested — though still among its worst-ever election performances.

Britain's opposition Conservatives, led by the youthful Cameron, made some advances — but failed to gain a single council seat in the northern city of Manchester, deemed a key test of the party's revival and ability to win favor in Labour's traditional heartland.

In 1970, Conservatives held 62 parliamentary seats in the north, compared with 19 following the 2005 general election.

Leighton Vaughan Williams, political analyst at Nottingham Business School, said the Conservatives had not shown enough progress to suggest they would sweep the next national poll — expected in 2009.

Treasury chief Gordon Brown — Blair's likely successor — had some cause for optimism, Williams said. "Margaret Thatcher's Tories used to suffer hellish beatings in midterm local polls in the 1980s," he said. "But every time, they stormed back to victory in national elections."

Scottish National Party leader Alex Salmond won a seat to the Scottish parliament for the first time, in the northeastern district of Gordon, telling voters he would combine the role with his duties as a lawmaker in London's House of Commons.

"I am absolutely confident that when these results are counted," Salmond said. "We shall all have to accept that new politics is dawning in Scotland."

Blair had urged Scottish voters not to turn to the nationalists just to give him "a kicking one last time on my way out of the door."

Counting in Scotland began late Thursday, but was blighted with problems: On the remote Western Isles a helicopter due to carry ballot boxes to a counting hall was grounded by heavy fog; a boat ferrying votes from the Scottish isle of Arran suffered engine failure and in Edinburgh, police arrested a man who attacked ballot boxes with a golf club.