Labour lawmaker Sadiq Khan is poised to become the next mayor of London, which would mark the first time a Muslim candidate was elected to lead a major Western city.
The official announcement has not been made, but Labour leader Jeremy Corbyn tweeted his congratulations, adding the hashtag "YesWeKhan" in a play off U.S. President Barack Obama's campaign slogan.
New York Mayor Bill de Blasio also sent his congratulations, calling Khan "London's new mayor and a fellow affordable housing advocate."
Khan, 45, was a favorite to replace flamboyant Conservative Boris Johnson as mayor, after a race marred by allegations of extremism and fear-mongering.
Opinion polls had put him far in the lead, with a 20-point advantage over main rival Zac Goldsmith, a Conservative and the son of a billionaire.
Khan, a former human rights lawyer, has promised to be "the British Muslim who takes the fight to the extremists." In an election-eve message, Khan promised to be "a mayor for all Londoners."
"I urge Londoners to choose hope over fear," he said.
Khan is the son of a bus driver from Pakistan and grew up with seven siblings in a three-bedroom government-subsidized apartment. He resonated in an expensive city where rocketing rents and property values are squeezing out even middle-class workers.
The bruising election drew comparisons to the contentious U.S. presidential campaign.
Goldsmith has for weeks focused on Khan's past career as a human-rights lawyer that included public appearances alongside radical Muslim speakers, accusing Khan of giving "platform, oxygen and cover" to extremists
Khan accused Goldsmith of running a "nasty, dog-whistling campaign."
Khan is among the majority of London's 8.2 million inhabitants not classified as "white British." According to the 2011 census, one in eight Londoners is a Muslim and 35 percent of the British capital's residents were born overseas.
This article first appeared on NBCNews.com.