"Sadiq Khan has done a terrible job as Mayor of London," Donald Trump said. (AFP)

Donald Trump lashed out at London Mayor Sadiq Khan on Monday, calling him a "stone-cold loser" after the mayor criticised the British government for inviting the U.S. president for a state visit.

On Monday, Trump arrived in Britain with his wife Melania for a three day visit, and he had already blasted Khan before his plane touched down.

"@SadiqKhan, who by all accounts has done a terrible job as Mayor of London, has been foolishly 'nasty' to the visiting President of the United States, by far the most important ally of the United Kingdom," Trump said on Twitter shortly before Air Force One landed at Stansted Airport near London.

"He is a stone cold loser who should focus on crime in London, not me."

On Sunday, Labour's Khan said it was important to have good relations with the United States but that Britain should not be "rolling out the red carpet" for Trump. He has also compared Trump to 20th century fascists.

"This is much more serious than childish insults which should be beneath the President of the United States," a spokesman for the mayor said.

"Sadiq is representing the progressive values of London and our country warning that Donald Trump is the most egregious example of a growing far-right threat around the globe."

Trump will be treated to a display of British royal pageantry during the June 3-5 visit: lunch and a formal dinner with Queen Elizabeth, tea with heir Prince Charles, and a tour of Westminster Abbey, coronation church of English monarchs for 1,000 years.

He will also commemorate the 75th anniversary of the World War Two D-Day landings, and foreign minister and Conservative leadership candidate Jeremy Hunt said the trip should be above party politics.

Hunt, who greeted Trump at Stansted Airport, said that Trump had mentioned the mayor to him on arrival.

"He wasn't exactly saying that he's going to be inviting Sadiq Khan for royal treatment at the White House any time soon," Hunt told the BBC, declining to give further details of the conversation.