Most of Theresa May’s visit to the United States this week followed a fairly familiar pattern for such trips. Except for one thing. The press conference between the prime minister and Donald Trump in the White House today was an off-the-scale risk. Politically, it was a dash across sniper’s alley. Mr Trump might again say something new and shocking. Mrs May would have to respond. Not surprisingly, there was doubt about whether there would even be a press conference. Rightly, it went ahead. The stakes for both leaders were very high and different. But they got safely to the other side.

The dangers all concerned Mr Trump. He duly said some provocative things and some embarrassing ones. He repeated his support for waterboarding and torture, several times, which was shameful. He said he was up for a great relationship with Vladimir Putin, which Mrs May was not. He was rude about Mexico. He was angry, with a smile on his face, with the BBC’s political editor. His performance was a reminder of the immense damage his election has already done to America and its place in the world. But he said nothing new that will add massively to the many rows and outrages in which he is already embroiled.

For Mrs May the danger was of being collateral damage in a Trump explosion. Since there was no explosion, she will count the event and the visit more generally as successes. Her speech in Philadelphia on Thursday night raised her profile and went down well, deservedly so in some ways. The prime minister may even be tempted to think that she can take some credit for Mr Trump’s good – or less bad – behaviour. That may seem naive if Mr Trump’s state visit to the UK implodes or turns sour in some way later in the year. Mrs May should beware any feeling of confidence about her relationship with the new president. Other prime ministers have passed this way before and ended up humiliated.

The big political prize for Mrs May was her assertion, not repeated by Mr Trump but not denied either, that the president is 100% behind Nato. This is an important outcome, if true. The message will be heard in every Nato capital, especially in eastern parts of Europe, and will be heard in the Kremlin too. Quite what Mr Trump’s 100% support means in practice remains to be seen. Mrs May seemed very keen to lobby for all Nato states to raise their spending level and to raise their defence equipment spending too. It is hard to know whether, post-Brexit, she has the clout or whether she and other Europeans see eye-to-eye on outcomes. Yet, given Mr Trump’s earlier scorn for Nato, this was a big prize.

It is, though, early days, as Mr Trump himself said. That applies in particular to any prospective trade deal between the UK and the US. The US is traditionally a powerful and an uncompromising trade negotiator. It looks to advance American interests, not those of its partners – as Mr Trump made clear on Mexico. Nothing will happen soon, and London’s optimism is almost certainly misplaced. Mr Trump’s vocal embrace of Brexit will have caused real anxiety in Brussels and around the EU – and annoyed his UK opponents too. Mrs May’s eagerness to get round the table in the Oval Office will be seen by some as a disruptive act against the EU, whatever she herself thinks. The French presidential hopeful Emmanuel Macron said precisely this today.

The main danger facing any British prime minister in the relationship with America is hubris. Pushed by the press and fired by Britain’s seemingly indestructible institutional desire to be loved by America, prime ministers feel the need to seize first friend status and hug it close. Sometimes, however, this can become a destructive desire, as Tony Blair found in his relationship with George W Bush. These visits ought not to matter too much. But they do. Mrs May will feel that she did well. All of us are glad it is now over. In the end, though, Mr Trump is the master of his own fate and, if Mrs May is not careful, he will be master of hers as well.