Trump for Boris: President Tips Johnson for U.K. Prime Minister Before Dinner With Theresa May

President Donald Trump has heaped praise on the U.K.'s gaffe-prone, ex-foreign secretary, arguing "he's got what it takes" to become a great leader of the country. Trump's statement comes amid a deepening rift in the British government over Brexit.

Trump arrived in the U.K. earlier this week, his first visit to the historic U.S. ally since taking office, after previous plans to visit the country faltered. He landed in the U.K. on Thursday, days after a rift inside the British government over plans to exit the European Union prompted two senior ministers to resign. Boris Johnson, who was mayor of London before he became foreign secretary, was one of them.

Rumors of the flamboyant, off-message ex-minister's leadership ambitions have weighed on the premierships of two prime ministers from his party, including Trump's host on this trip, Theresa May. This did not prevent Trump from telling one tabloid newspaper that Johnson was the sort of prime minister he wanted to see at 10 Downing Street.

Live Updates: President Donald Trump in the U.K. To Meet Prime Minister May and the Queen

First Lady Melania Trump, President Donald Trump, Britain's Prime Minister Theresa May, and her husband, Philip May, stand on the steps in the Great Court to watch the bands of the Scots, Irish and Welsh Guards perform a ceremonial welcome. Brendan Smialowski/AFP/Getty Images

"I have a lot of respect for Boris," Trump told British newspaper The Sun before he arrived in the U.K. "He obviously likes me, and says very good things about me."

Johnson has issued some measured backing for Trump, such as praising his tweets for having "engaged people in politics in a way that we haven't seen for a long time," but he has also voiced opinions critical of the anti-immigration president, which are close to the British mainstream view.

Among many things, Johnson called Trump, when he was still a presidential candidate, "clearly out of his mind," and "unfit to hold the office of president of the United States," in response to Trump's proposal to "shut down" Muslims entering the U.S. Last month, however, a leaked recording of Johnson endorsed Trump as a model for negotiating Brexit "bloody hard," causing "all sorts of chaos... but actually you might get somewhere." Trump returned the compliment this week, telling the British tabloid: "I think he is a great representative for your country.

"I was very saddened to see he was leaving government, and I hope he goes back in at some point," Trump said. Johnson's resignation increased pressure on Prime Minister May, who is racing against time to strike a deal to exit the EU, despite profound divisions across the country and inside parliament. Trump dismissed the idea that his expressed fondness for Johnson—proponent of a much harder Brexit approach than May—was a swipe at the sitting prime minister.

"I am not pitting one against the other," he said. "I am just saying I think he would be a great prime minister. I think he's got what it takes." He dismissed reports that he'd called May a "bossy schoolteacher" after their last meeting, adding she was "a nice person."

Trump was less courteous to Johnson's popular mayoral successor, Sadiq Khan. He'd previously misquoted Khan's call for calm following an extremist attack in London last year, triggering Twitter outrage around the British capital's first Muslim mayor. "You have a mayor who has done a terrible job in London. He has done a terrible job," Trump said. "Take a look at the terrorism that is taking place. Look at what is going on in London. I think he has done a very bad job on terrorism."

"I think he has done a bad job on crime, if you look, all of the horrible things going on there, with all of the crime that is being brought in," he said.

Trump has made similar claims about the German government's alleged law enforcement failings, though in reality crime is down in Germany to its lowest level since 1992. During the interview Trump hit out at pro-refugee and freedom of movement policies in Europe, saying: "I think allowing millions and millions of people to come into Europe is very, very sad. I think you are losing your culture. Look around. You go through certain areas that didn't exist 10 or 15 years ago."

The British shadow Secretary of State Emily Thornberry said Trump's attacks on the London mayor stemmed from prejudice. "It's Islamophobia, and it is racist," she told LBC radio. "I'm afraid it is absolutely in Donald Trump's playbook. It just shows what a terrible president he is."

The U.S. president admitted he felt "unwelcome" in the British capital, where many planned to protest his fleeting visit—he will spend most of his time away from major cities. He blamed the government for his not feeling wanted in London, insisting "the ­people of the U.K. agree with me." The British public largely disapproves of Trump: Only 11 percent view him as a great or even good president, while 67 percent said he was "bad" or "terrible" as commander-in-chief.

Arguably, Trump's warmest praise was reserved for the British monarch, Queen Elizabeth II, calling her "a tremendous woman" before their first meeting on Friday. "I really look forward to meeting her. I think she represents her country so well. If you think of it, for so many years she has represented her country, she has really never made a mistake. You don't see, like, anything embarrassing. She is just an incredible woman," he said. "My wife is a tremendous fan of hers. She has got a great and beautiful grace about her."