Sadiq Khan, the son of Pakistani immigrants who won a landslide victory in this week’s London mayoral election, was sworn in on Saturday in a multifaith service at Southwark Cathedral, becoming the British capital’s first Muslim mayor.

Khan’s wide margin of victory was seen as a repudiation of the Islamophobic campaign waged by his main rival, the Conservative Party candidate Zac Goldsmith, whose own sister, Jemima, expressed regrets about it after her brother’s 14-point defeat was confirmed.

Sad that Zac's campaign did not reflect who I know him to be- an eco friendly, independent- minded politician with integrity.

The 1.3 million votes Khan won as the Labour Party candidate gave him the largest personal mandate of any directly elected leader in British history. That achievement, and his rise from humble origins, won him praise from Britons online, even Conservatives like Sajid Javid, the business secretary, and Sayeeda Warsi, a former cabinet minister — who were both, like Khan, the children of Pakistani bus drivers.

Baroness Warsi, who is now in the House of Lords, also denounced the Goldsmith campaign for relying on barely concealed racist messages, like falsely implying that Khan could be linked to Islamic extremists.

Our appalling dog whistle campaign for #LondonMayor2016 lost us the election, our reputation & credibility on issues of race and religion.

Pakistanis watched from afar with pride, but also an awareness that the upwardly mobile trajectory of the Urdu-speaking lawyer’s career — which led him from subsidized housing to the House of Commons and then City Hall — would have been far less likely in his parents’ homeland.

Wonderful multicultural, multireligious ceremony. Watching live on Pak TV. As public diplomacy for UK: priceless. pic.twitter.com/S2OYmGIvh2

As Hendrik Hertzberg, the New Yorker writer, observed, if Khan’s election were to be followed in November by a victory for Donald Trump, his complete ban on Muslims visiting the United States would make even London’s mayor persona non grata.

Under President Trump, the mayor of London will be barred from entering the United States.

The warm glow on Saturday stood in contrast to a striking image from the night before, when the result was first announced. As Khan stepped to the microphone to speak, a minor party candidate for the extreme nationalist Britain First party turned his back.

In a brief speech after he signed the oath of office, Khan referred to the Goldsmith campaign’s failed effort to appeal to that sort of prejudice. “Fear doesn’t make us safer, it only makes us weaker,” he said, “and the politics of fear is simply not welcome in our city.”

In an interview with the political editor of Sky News, Faisal Islam, Khan said that it was not up to him to say if the Conservative Party’s leader, Prime Minister David Cameron, should apologize for having taken part in the effort to smear him. But, he said, “I think it’s for them to ask themselves the question, how is it that, in the most diverse, fantastic city in the world, they chose to have a negative, desperate, and divisive campaign?”