Cameron told a campaign event in London that he and the new Labour mayor backed Britain's EU membership because "we love our country and we want our country to be the best it possibly can," just weeks after accusing Khan of repeatedly appearing with Muslim extremists.
"I'm proud to be here with the Labour mayor of London," said Cameron.
"He is the son of a bus driver and it makes an important point about our country: 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."
Khan admitted there were there "many things upon which the prime minister and I will disagree," but said "when it's in London's interest for the mayor of London and the government to work closely together, we will work closely together".
While Cameron was building bridges with former adversaries, dissent within his own ranks escalated with some Tory MPs demanding he quit even if the country voted to remain in the bloc at the June 23 referendum.