Kevin Lamarque / Reuters

President Donald Trump has long had warm words for Boris Johnson, who always seemed destined to make it to the runoff in the race to become Britain’s next prime minister. But Johnson, who on Thursday officially became one of two candidates left in the race to succeed Theresa May, hasn’t always had warm words for Trump.

Johnson, who won the support of more than half of Conservative Party lawmakers, and Jeremy Hunt, the other finalist, will now embark on a weeks-long, cross-country campaign to court votes from the wider Conservative Party membership, which will decide who will go to Downing Street. For many Tories, though, this race is as good as decided: A majority say they believe Johnson is the best man for the job; the candidate most capable of delivering Brexit and, when the time comes, best poised to strike trade deals with other countries—including with Britain’s most special ally, the United States.

Even Trump seems to think so. He has called Johnson “a friend of mine” who would make an “excellent” leader. During his recent state visit to Britain, Trump committed to making a “phenomenal trade deal” with Britain after it left the European Union, and even went as far as to request a meeting with Johnson, the front-runner in the leadership race, while he was in town (Johnson reportedly turned down the offer, though they spoke by phone for 20 minutes). The two leaders have become so linked that some have even started referring to Johnson as Britain’s “mini Trump.

But in the not-so-distant past, such a relationship appeared highly unlikely—if not outright impossible. “I think Donald Trump is clearly out of his mind,” Johnson, who was at the time the mayor of London, said of then-candidate Trump’s 2015 call to ban Muslims from entering the United States. In response to the Republican hopeful’s early criticisms of London, which Trump erroneously described as having “no-go areas” teeming with Islamic extremism, Johnson said Trump betrayed “a quite stupefying ignorance that makes him, frankly, unfit to hold the office of president of the United States.”

On the prospect of a Trump visit to London, Johnson said he would welcome the president, “except that I wouldn’t want to expose Londoners to any unnecessary risk of meeting Donald Trump.” In some ways, Johnson’s thoughts about Trump when he served as London mayor were similar to those of his successor to that position, Sadiq Khan.

London’s mayor may have changed, but Trump’s attacks on the British capital haven’t relented since he entered the White House. In fact, the president has taken his criticisms of the city even further—this time though a years-long Twitter feud with Khan. A “stone cold loser” is how Trump described Khan before touching down in London for his state visit this month. Weeks later, the president amplified a tweet by a right-wing British commentator who described weekend violence in the city as a product of “Khan’s Londonistan.” The president’s tweet was condemned by most of the Conservative Party leadership candidates. (Johnson didn’t comment.)

Johnson’s recent unwillingness to publicly spar with Trump could be regarded as the behavior of a prime minister in waiting. As the leading candidate to be the next custodian of the “special relationship” between the U.S. and the U.K., Johnson has no incentive to do anything that could further aggravate tensions between the two countries—especially if it means sacrificing the possibility of striking a U.S.-U.K. trade deal. Should Brexit happen by the end of October, as Johnson has advocated, that relationship will be more crucial than ever to Britain.

But the relationship could be warming for other reasons. After all, there are plenty of similarities between the two men: They both have roots in New York City (Johnson was born in Manhattan’s Upper East Side, just across the river from Trump’s native Queens). Both sport trademark disheveled hairdos. And both have crafted political personas that feed off their own celebrity: For Trump, it’s his high-profile career as a real-estate mogul; for Johnson, it’s his public image as a bumbling politician always stumbling (or zip-lining) from one gaffe to the next.

Beyond the superficial, each has established patterns of governance that would make the other a strong ally. They have run nationalist campaigns that appealed to the grievances of those who have felt left behind in their respective countries. And both have made false claims in pursuit of their aims: Johnson pledged that a vote for Brexit would save the country £350 million ($470 million) per week to invest in Britain’s National Health Service, and Trump promised that Mexico would pay for the wall at the U.S.’s southern border. Neither Johnson nor Trump has shied away from saying offensive things—most notably toward Muslims and other minorities—along the way.

Still, just because they seem like perfectly suited transatlantic partners doesn’t necessarily mean they will be. “People think that because they’re strong, rogue, independent people, that’s all naturally aligned,” Leslie Vinjamuri, the head of the U.S. and the Americas Program at the London-based Chatham House think tank, told me. But the two leaders also have some fundamental differences: Whereas Trump has positioned himself as an outsider who is removed from the elite, Johnson is firmly entrenched in it. “Boris Johnson has been in British politics, he went to [the elite private school] Eton, he’s in all the elite circles—he’s an inside rogue.”

Most importantly, though, is that Johnson is an insider who wants to be prime minister—an ambition that could be compromised by being seen as too cozy with one of the most unpopular foreign leaders in Britain today.

“Boris Johnson, if he becomes prime minister, is going to have to manage Britain’s relationship with the U.S., but I don’t think he’s going to be thrilled about having Donald Trump as his sort of close friend,” Vinjamuri said. “It’s likely to be slightly more complicated than that.”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.