David Cameron hailed "proud Brit" Sadiq Khan's election as a symbol of progress in reducing racial and religious discrimination as he sought to mend fences with the London Mayor.
The Prime Minister was condemned for repeatedly seeking to link the Labour politician with Muslim "extremists" as part of the push to get Tory Zac Goldsmith into City Hall.
He was accused of racism in the Commons after joining in an ill-fated campaign damned as "divisive" by many, including senior Conservatives.
But he publicly shook hands with Mr Khan as he enlisted his support for the campaign to persuade voters to back continued EU membership in a joint appearance in the capital.
"In one generation someone who is a proud Muslim, a proud Brit and a proud Londoner can become mayor of the greatest city on earth," he said as he offered his congratulations.
"That says something about our country.
"There are still barriers to opportunity that we have to get rid of. There are still glass ceilings we have got to smash. There is discrimination in our country that we have to fight.
"But I have always said - and I say it again today standing alongside our new mayor - that we can claim to be on track to be the best multi-faith, multi-ethnic opportunity democracy anywhere on earth, and we should be proud of that."
Mr Cameron went on: "We will disagree about many things. We have in the past; I'm sure we will again in the future.
"But we are both on the side of London, we are both on the side of the United Kingdom. I want that spirit of unity of purpose to be with us today."
Mr Khan - appearing alongside the PM in front of students in south-west London - said he would work closely with the Tory government "where it is in Londoners' interests".
"The reason why London is the greatest city in the world - and it is - we have never taken an isolationist approach, we are open-minded, we are outward-looking, we embrace other cultures and learn from other cultures and ideas as well," he said.