Donald Trump has said that if he wins power in the US presidential election he is unlikely to have a good relationship with David Cameron because of the British prime minister's criticism of him.

Mr Cameron told the British parliament last year that the Republican was "divisive, stupid and wrong" for calling for a temporary ban on Muslims entering the United States.

He said at the time that if Mr Trump came to Britain, he would unite the country against him.

Speaking in an interview on ITV, Mr Trump said: "It looks like we're not going to have a very good relationship, who knows, I hope to have a good relationship with him but it sounds like he's not willing to address the problem either."

When asked about Britain's membership of the EU, subject of an upcoming referendum, Mr Trump said: "I've dealt with the European Union, it's very, very bureaucratic, it's very, very difficult. In terms of Britain I would say 'what do you need it for?' But again, let people make up their own mind."

A spokesman for Mr Cameron today said the prime minister stands by his description of Mr Trump's proposal as "divisive, stupid and wrong".

The spokesman said Mr Cameron had been clear he would work with whoever is president and he was committed to maintaining the special relationship with Washington.

Donald Trump also criticised new London Mayor Sadiq Khan, calling him "ignorant" for comments he made after being elected and warning him: "I will remember those statements."

When elected as London Mayor, Mr Khan said Mr Trump was "ignorant" in his views on Islam and he risked harming security on both sides of the Atlantic.

Mr Trump said: "He doesn't know me, hasn't met me, doesn't know what I'm all about. I think they were very rude statements and frankly tell him I will remember those statements. They are very nasty statements."

He added: "When he won I wished him well. Now, I don't care about him, I mean it doesn't make any difference to me, let's see how he does, let's see if he's a good mayor."

Asked if he was offended by Mr Khan's public denouncement he replied: "Yeah, I am."

Mr Trump denied he was "at war" with Mr Khan, who said the tycoon's "ignorant view of Islam could make both of our countries less safe - it risks alienating mainstream Muslims around the world and plays into the hands of extremists".

Mr Trump said: "I just think it's very rude of him. In fact it's the opposite. I wished him well when I heard he won, he's a Muslim ... I think it's ignorant for him to say that."

Obama slams Trump 'ignorance' in speech

Meanwhile, US President Barack Obama has criticised Mr Trump in a speech, decrying "anti-intellectualism" and noting that "ignorance is not a virtue".

Mr Obama did not specifically name the brash New York real estate developer during his remarks at a university graduation ceremony in New Jersey, but it was clear he was referring to the candidate who is running on a slogan of "Make America Great Again!"

The Democrat told students not to pine for an American golden age of years past, saying, "The good old days were not all that good," as he pointed out problems with racial discrimination, poverty and lack of equality for women.

"The world is more interconnected than ever before and it is becoming more connected every day. Building walls won't change things," Mr Obama said, an apparent jab at Mr Trump's calls for a wall along the US-Mexico border to keep illegal immigrants out.

"Suggesting that we can build an endless wall along our borders and blame our challenges on immigrants, that does not just run counter to our history as the world melting pot," he said.

"It contradicts the evidence that our growth and our innovation and our dynamism has always been spurred by our ability to attract strivers from every corner of the globe."