Sadiq Khan, the two-term center-left mayor of London, was poised on Saturday to become the first three-time winner of the job by a clearer margin than some of his supporters had predicted.
Mr. Khan, from the main opposition Labour Party, was initially elected to the post in 2016, becoming London’s first Muslim mayor, and would now become the first politician to win three consecutive terms since the role was created in 2000.
With the Labour Party well ahead in the opinion polls ahead of a looming general election, many analysts had expected Mr. Khan to cruise to a comfortable victory in a city that tends to lean to the left, but some saw the potential for an unexpectedly tight race against Susan Hall, representing Britain’s governing Conservative Party.
That prospect quickly faded on Saturday, with Mr. Khan’s party declaring victory and the BBC forecasting him as the winner after results from half of London’s regions showed the mayor exceeding his performance in his last election, in 2021.
“Sadiq Khan was absolutely the right candidate,” said Keir Starmer, leader of the Labour Party. “He has got two terms of delivery behind him and I am confident he has got another term of delivery in front of him.”
The vote itself took place on Thursday along with other local and mayoral elections in which the Conservatives, led by Britain’s embattled prime minister, Rishi Sunak, suffered a series of setbacks.
The electoral system for London’s mayor has changed since Mr. Khan was last re-elected in 2021, and the government has also introduced a new requirement for voters to produce photo ID. Some analysts feared that might deter poorer and younger voters among whom Labour tends to poll well.
Amid a squeeze on living standards, and with limited powers as London mayor, Mr. Khan had to battle to convince Londoners that he was improving their lives. Opinion polls before the vote gave him a strong lead over his Conservative rival, but a smaller advantage than his party enjoys in national surveys.
Ms. Hall had campaigned to reduce the area covered by London’s Ultra Low Emission Zone, or ULEZ, an antipollution measure that charges the owners of some older vehicles 12 pounds and 50 pence, about $15.50, for every day they drive.
While inner London is a stronghold of the Labour Party, the Conservative Party normally polls significantly better in the more suburban areas of outer London, where a much larger proportion of households own cars. Last year when Mr. Johnson quit Parliament, the Conservatives won a special parliamentary election to replace him in Uxbridge, the district he had represented in outer London, after campaigning against ULEZ.
The backlash from owners of older vehicles in the area prompted a wider rethink within government over the cost of environmental policies. Not long after the Uxbridge contest Mr. Sunak announced a weakening of Britain’s climate change targets.
In her campaign Ms. Hall also targeted Mr. Khan’s record on fighting crime in the capital, although one of her party’s attack ads, which showed people running to safety, attracted ridicule when it emerged that the images used were filmed not in London but at Penn Station in New York in 2017.
After finding her wallet missing last year, Ms. Hall told the radio station LBC that she thought it had been taken from her pocket on a London Underground train, using the episode as an example of how crime was out of control under Mr. Khan. The wallet was later returned by a retired businessman, who said that he had found it on a train seat and that it appeared to have been lost rather than stolen and discarded.
Ms. Hall also faced criticism after previously suggesting that the Notting Hill carnival, a famous annual Caribbean street event in West London, should potentially be relocated in the interests of public safety, and liking a social media post describing Mr. Khan as “the nipple-high mayor of Londonistan.”
Mr. Khan was on the receiving end of a more directly anti-Muslim attack from Lee Anderson, a lawmaker who was suspended from the Conservative parliamentary party after he claimed that Islamists had control of London because Mr. Khan had “given our capital city away to his mates.”
Mr. Anderson admitted his remarks were a “little bit clumsy” but refused to apologize, and later joined Reform U.K., a small right-wing party.
But it was former President Donald J. Trump who became the London mayor’s best known critic, feuding with him since 2016 on issues including immigration and terrorism. In 2019, after the mayor publicly opposed his state visit to Britain, the former president accused Mr. Khan of being “nasty” to him, while misspelling his name and mocking his stature.
“Kahn reminds me very much of our dumb and incompetent Mayor of NYC, de Blasio, who has also done a terrible job — only half his height,” Mr. Trump wrote on social media, invoking another favored target, Mayor Bill de Blasio of New York.
Soon afterward, Mr. Trump also called the London mayor “a disaster,” citing several stabbings in Britain’s capital, and writing on social media that London needed to replace Mr. Khan as soon as possible.
Given the Mr. Trump is not popular in Britain, the former president’s attacks are unlikely to have damaged Mr. Khan.