By William James and Elizabeth Piper
Sadiq Khan, the son of a bus driver, has become London's first Muslim mayor, seeing off a Conservative challenger who attempted to link him to extremism and securing a much-needed victory for his opposition Labour Party.
As New York mayor Bill de Blasio sent his congratulations, Khan had yet to receive official notification of his victory, which would go some way to soothing the wounds of Labour which suffered losses in Thursday's other local elections.
Dealt a crushing blow in Scotland, where it came third behind the Scottish National Party and Britain's ruling Conservatives, Labour did better than expected in England, saving its left-leaning leader from an early challenge.
But the big prize was the London mayor vote, which pitted Khan, 45, who grew up in public housing in inner city London, against Conservative Zac Goldsmith, 41, the son of a billionaire financier.
A source close to the count on Friday said Khan could not now be beaten in the race.
De Blasio said on Twitter: "Sending congratulations to London's new mayor and fellow affordable housing advocate, @SadiqKhan."
Khan's margin of victory looked set to be narrower than expected in a possible sign that a bitter campaign marred by charges of anti-Semitism and extremism and charges of anti-Semitism in Labour ranks might have taken its toll.
The Labour lawmaker replaces Conservative Boris Johnson, who has run the city of 8.6 million people for eight years.
A top campaigner for Britain to leave the EU, Johnson is seen as a contender to succeed David Cameron as party leader and prime minister.
The Conservatives were keen to keep hold of the post, which does not run the City of London financial district but has influence over government in lobbying for the capital.
The mayor is responsible for areas such as policing, transport, housing and the environment.
Khan, a former human rights lawyer, held his lead in the opinion polls, despite accusations by Goldsmith that he has shared platforms with radical Muslim speakers and given "oxygen" to extremists.
Khan says he has fought extremism all his life and that he regrets sharing a stage with speakers who held "abhorrent" views.
The Labour Party accused Goldsmith and the ruling Conservative Party of smearing Khan.