London (AFP) - London's new Muslim mayor Sadiq Khan accused Prime Minister David Cameron on Sunday of using "Donald Trump playbook" tactics to try to divide communities in a bid to prevent his election.

The day after being sworn in with a promise to be "mayor for all Londoners", the Labour lawmaker condemned Cameron's Conservatives for trying to link him to Islamic extremists during the election campaign.

"They used fear and innuendo to try to turn different ethnic and religious groups against each other -- something straight out of the Donald Trump playbook," Khan wrote in The Observer newspaper.

"Londoners deserved better and I hope it's something the Conservative party will never try to repeat."

Khan won 57 percent of the vote in Thursday's mayoral election, securing 1.3 million votes to see off multimillionaire Tory Zac Goldsmith and making history as the first Muslim mayor of a major Western capital.

The 45-year-old, the son of a Pakistani immigrant bus driver, hailed his victory as a triumph of "unity over division" after weeks of Tory criticism over his past appearances at public events alongside radical Muslims.

A number of Conservative politicians criticised the tone of the campaign, but Defence Secretary Michael Fallon said the questions raised had been legitimate.

Khan had admitted representing some "pretty unsavoury characters" during his previous job as a human rights lawyer but said their views were "abhorrent".

"Both candidates were asked questions about their backgrounds, their personalities, their judgment, the people they associate with," Fallon told BBC radio.

"That's the nature of our democracy and the rough-and-tumble of politics."

- Clinton sends congratulations -

Khan broke from convention by taking his oath of office in a multi-faith ceremony at Southwark Cathedral, promising to represent "every single community, and every single part of our city, as mayor for all Londoners".

Hillary Clinton, who as the likely Democratic nominee will face presumptive Republican nominee Trump in the race for the US presidency, led international congratulations.

Story continues

"Son of a Pakistani bus driver, champion of workers' rights and human rights, and now Mayor of London. Congrats, @SadiqKhan. -H" she tweeted.

New York Mayor Bill de Blasio said he was looking forward to working with his "fellow affordable-housing advocate" while Paris Mayor Anne Hidalgo tweeted that Khan's "humanity (and) progressivism will benefit Londoners".

In Pakistan, Bilawal Bhutto, leader of the opposition Pakistan People's Party and son of former prime minister Benazir Bhutto, and rival opposition leader Imran Khan also tweeted their congratulations.

Former Conservative minister Sayeeda Warsi, herself a daughter of a Pakistani bus driver, hailed Khan's victory and condemned her party's attacks against him.

"Our appalling dog-whistle campaign lost us the election, our reputation and credibility on issues of race and religion," she said.

Cameron's former adviser, Steve Hilton, said Goldsmith had brought back the Conservatives' "nasty party label".

- Labour losses elsewhere -

Khan broke the eight-year hold of the Conservatives on City Hall and succeeds the charismatic Boris Johnson in a prestigious post that has responsibility for transport, housing, policing and promoting economic development.

His success is a boost for Labour leader Jeremy Corbyn, a veteran socialist who has been battling a row over anti-Semitism and growing criticism from the moderate wing of his party since his election in September.

But Corbyn was conspicuously absent from Khan's signing-in ceremony and in his article, the new mayor appeared to criticise the way Labour was being run.

The party "only wins when we face outwards... and engage with all voters", Khan wrote, adding: "It's crucial for the whole country that the Labour party becomes a credible government-in-waiting."

Labour fared less well in other elections held Thursday.

The party was beaten into third place in Scotland, once a Labour stronghold, as the Conservatives became the official opposition to the Scottish National Party (SNP), which won a third term in office.

Labour maintained control of the Welsh assembly and lost only a handful of local council seats in England.

But critics said it should have done better against a government that has lost support over welfare reforms and is deeply divided ahead of the referendum on Britain's membership of the EU on June 23.