Since the Second World War, British prime ministers have had two overriding foreign policy goals: to their country’s “special relationship” with the United States (the phrase was coined in 1944 by Winston Churchill) and to promote the integration of Europe (as a way of preventing future wars). The dilemma the current prime minister, Theresa May, faces is that the election of Donald Trump, with an “America First” foreign policy that includes a hostility to institutions like the European Union and NATO, is forcing her to pick between those two goals. Even as she negotiates an exit from Brexit, May has, until now, kept faith to the idea that a united Europe is in Britain’s best interest. But as she meets with Trump on Friday, it’s clear that she’s decided to give priority to the relationship with America even if it means alienating traditional European allies.

The decision to infuse new energy into the special relationship in the age of Trump is, in some ways, a surprising one. In her public persona as a grounded, level-headed paragon of middle-class common sense, May is world’s away from the vulgar and gaudy American president. In December of 2015, while serving as home secretary, May said Trump’s views on Muslim immigration were “absolutely wrong” and he “does not understand the U.K.” May has been hawkish on Russia, accusing Russian President Vladimir Putin of murdering a political opponent on British soil. Trump’s cultivation of the European far right extended to an act that personally insulted May: Before meeting May, he met with a member of another party, Nigel Farage of UKIP. Trump furthered the faux pas by calling on Farage to be made the U.K.’s ambassador to America. A more personal insult came Thursday when the Trump administration repeatedly misspelled May’s name on their daily guidance sheet.

Despite all this, May has given every indication that she wants to revitalize the “special relationship.” In Philadelphia on Thursday, she gave a speech where she emphasized her ideological affinity with the Republican party (something that her predecessor David Cameron notably avoided doing). “I speak to you not just as prime minister of the United Kingdom, but as a fellow Conservative who believes in the same principles that underpin the agenda of your Party,” May said. Her speech took a more tempered view of Russia, indicating that she was moving in the direction of Trump’s isolationism. Along this line, May declared that “the days of Britain and America intervening in sovereign countries in an attempt to remake the world in our own image are over.” These are words that White House senior adviser Steve Bannon could have easily written for Trump.

Speaking on the BBC program Newsnight, former Labour Party leader Ed Miliband warned that “to align yourself so close to [Trump’s] project ... is a mistake.” Miliband also said “we seem to be locking ourselves in Donald Trump’s boots.” In an economic sense, Miliband is surely right. Europe is a much more important partner to the U.K than the U.S. is. Moreover, given Trump’s erratic behavior, he’s likely to prove a very unreliable partner.

As The Economist explains, May’s decision to sidle up to Trump was born of desperation. As the U.K. negotiates with the much larger E.U., May needs all the leverage she can get. She’s hoping the possibility of a side agreement with the man who mastered “the art of the deal” will convince the Europeans that they need to treat Britain well.

“So why is Mrs May hurrying to Washington?” The Economist asks. “Because Brexit compels Britain’s leaders to show that the country has powerful allies. And ‘my Maggie’ (as the president calls Mrs May) is desperate to line up a Britain-America trade deal that can be closed as soon as Brexit takes place, probably in 2019.” While Brexit was supposed to make the U.K. more independent, the upshot has been that the British are more reliant on international relations than ever, especially with the U.S.

If May needs the U.S. to help give Britain more heft, Trump also needs May to shore up his foreign policy. Trump’s heterodox presidency has turned off many key allies: the president of Mexico, offended by the Wall that Trump wants the Mexicans to pay for, has cancelled a planned visit to Washington, German Chancellor Angela Merkel has been notably frosty, and Canadian Prime Minister Justin Trudeau praised the international Women’s March against Trump that took place last Saturday.

Simply hanging out with the likes of Nigel Farage is not enough. Trump has to prove that he can be a statesman who can hold his own in the international stage. Casting his friendship with May as a revival of the Ronald Reagan/Maggie Thatcher relationship is a good way for Trump to inject some much needed gravitas into his foreign policy.

The “special relationship” has been rooted in a shared culture and history and cemented by alliances during the two world wars. It has weathered rocky times, as when America opposed British intervention in Egypt in 1957 or the Reagan administration refused to side wholeheartedly with Britain during the Falklands War in 1982 and a year later invaded Grenada, a former British commonwealth. So it’s not surprising that May would continue to hold on to the “special relationship” even as Trump upends the international order. But the deeper motive for both May and Trump is surely anguish: Both May and Trump need all the friends they can find, so will cling to each other out of desperation.