Trump repaid Theresa May’s hospitality with an attack on her handling of “Brexit” and an effective endorsement of Boris Johnson, who just resigned from the government in opposition to May’s plan:

In an extraordinary intervention timed to coincide with his UK visit, Mr Trump said Theresa May ignored his advice by opting for a soft Brexit strategy.

And he warned her any attempts to maintain close ties with the EU would make a lucrative US trade deal very unlikely.

This is obnoxious interference in British politics on Trump’s part and will presumably be seen as such by most people there regardless of party. U.S. presidents should refrain as much as possible from commenting on or speculating about political developments in an another country, especially an allied one. It is even more important to avoid giving offense to the host government when the president is there on an official visit. In this case, Trump’s intervention seems sure to backfire.

It is a measure of how deeply loathed he is in the U.K. that Trump’s embrace of Johnson and his criticism of May are likely to doom Johnson’s prospects and bolster support for the prime minister. According to YouGov, 77% of Britons hold an unfavorable view of the president. Even among Conservative respondents, the unfavorable rating is 66%. There has rarely been an American president as politically toxic in Britain as this one, and any politician linked with him is likely to become similarly radioactive.

The prime minister was weakened by the Johnson and Davis resignations last week, but Trump’s attack is likely to cause her party and her opponents to rally behind her just as the president’s attacks on Trudeau and Canada had a similar effect last month. Even many of her detractors will probably hold their fire for fear of appearing to do his bidding. If Trump was hoping to undermine May’s position, his statements have likely had the exact opposite effect.