LONDON—Donald Trump said he is unlikely to have a good relationship with U.K. Prime Minister David Cameron if he becomes the next U.S. president because of Mr. Cameron’s earlier criticism of him.

“It looks like we’re not going to have a very good relationship, who knows,” Mr. Trump said in an interview with ITV News, which aired Monday.

Mr. Cameron’s spokesman responded that the prime minister stood by earlier comments that Mr. Trump, the likely Republican presidential nominee, was “divisive, stupid and wrong” for calling for a temporary ban on Muslims entering the U.S.

He added, however, that Mr. Cameron would work with whomever is president and said he was committed to maintaining the special relationship between the U.K. and the U.S.

He also said criticism from Sadiq Khan, London’s newly elected mayor and the first Muslim to hold the job, was nasty and offensive. Mr. Khan had called the Republican presidential nominee’s view of Islam ignorant and said his comments make both the U.K. and the U.S. less safe.