As close encounters go, this was bound to be a defining one. Angela Merkel, Europe’s most powerful, values-oriented, refugee-welcoming and Putin-resisting leader, finally met Donald Trump, potential wrecker of the west and liberal democracy.

The contrast couldn’t be starker, or the stakes higher. Here was a calm, ponderous and dedicated European brushing up against the man whose ignorance of foreign affairs seems fathomless, and whose brain seems to work in 140-character spurts of vulgarity and provocation. The lines of battle were drawn long before the visit, of course.

During his campaign, Trump had called Merkel’s migration policies “catastrophic”. Merkel delivered her own kind of blow, on the day of his election, stating that cooperation with the US could only exist on the basis of values, which meant respect for the inalienable dignity of mankind, whatever one’s origins or beliefs. After that, there were further, indirect swipes over trade, tariffs and Germany’s role in the eurozone.

It is perhaps no exaggeration to say that never since the second world war have a US president and a German leader been at such odds. Even during the transatlantic bust-up over the 2003 Iraq war, disagreements between George W Bush and Gerhard Schröder were managed with a veneer of diplomacy. (Remember how Condoleezza Rice, the then US secretary of state, reportedly said Germany should be ignored, while the French should be punished.)

To this should be added the gender dimension – one Theresa May brushed over when she was photographed outside the White House, holding hands with its occupant. No such show of touchy-feely schmoozing was on offer with Merkel.

Today’s meeting was set to be the most important for US-Europe relations since the end of the Soviet bloc. Nothing much happens in Europe without Merkel having a say. Yes, the European Union is going through a difficult patch, but talk of its demise has so far proved to be exaggerated.

The European project struggles on, despite the splitting headache caused by the Brexit process. Its wellbeing if not its survival ought to matter to the US: Merkel said as much in her Munich security conference speech last month, noting that the EU represents 22% of global GDP, the US 25% and China 15% (up from 2% in 1990). These are “the global shifts we are witnessing”, she pointed out. Business is the way to Trump’s brain – and that was clearly at play during Merkel’s visit.

Trump is no doubt Merkel’s idea of a nightmare US president. Growing up in the communist bloc, she always saw America as the key repository of western values. Ronald Reagan, who she met in 1991 while a junior minister in Helmut Kohl’s delegation, was a symbol of the steadfastness that won the cold war. Today Merkel clearly did not find Trump’s joke about both having experienced “wire-tapping” very funny.

First and foremost, she would want to contain Trump’s hostility to the EU in an attempt to neutralise the damage he can inflict on it. No other leader on this side of the Atlantic, and certainly not May – however laudable her words about the UK “overwhelmingly” needing “the EU to succeed” – could give that a better shot.

It will remain an uphill struggle. Trump is simply clueless about the EU and its complex equilibrium of freely chosen, shared sovereignty in the name of peace and democracy – words he hardly ever uses. The EU simply doesn’t fit with his America-first, zero-sum game of the world. And he’s fully intoxicated by the ideology of his point man Steve Bannon. Trump only sees a supranational, domineering, repressive entity. His choice of envoy to the EU compared it to the Soviet Union.

In January Merkel ended up having to “explain” the Geneva refugee convention to Trump over the phone. Would a crash course on EU institutions now be warranted? Merkel’s task, as long as she remains Germany’s chancellor, will be to teach Europe 1.0 to Trump.

Donald Trump and Theresa May holding hands outside the White House. “No such show of touchy-feely schmoozing was likely to be on offer with Merkel.” Photograph: Pablo Martinez Monsivais/AP

There is a simple reason for this: without a shared, democratic European destiny, Germany simply cannot operate effectively. Its key foreign policy pillars are the Euro-Atlantic structures, along with the open trade made possible by the security they provide. Trump has, so far at least, done nothing to dismantle Nato, nor roll back on its plans to strengthen defences in the east. The alliance seems secure for now. Today Merkel said she felt “gratified” about that. That leaves Germany needing to prop up the EU – a body shaken to its core by populists and demagogues whom Trump has done much to inspire.

In the UK, the Brexit mess plays a role that some German officials are discreetly furious about. In the run-up to Merkel’s Washington visit, sources in Berlin confided their blunt irritation with the connections and influence that “crazy Tory Brexiters” enjoy in circles close to the new White House, especially the rightwing Heritage foundation.

Nigel Farage’s antics in the golden-gilded settings of Trump Tower are well known. But that the likes of the MEP Daniel Hannan and other British anti-EU Conservatives have long flirted with the American far-right and the Bannon crowd is a much bigger source of irritation. From a German point of view, this toxic brand of “special relationship” is a threat to Europe. It’s unlikely to ease Britain’s negotiations with the EU, and much more likely to corrode whatever goodwill might remain on the continent.

Trump’s belief that the EU is dying and that Brexit is its first convulsion may well run up against the reality of European resilience. The electoral defeat of the Dutch far-right leader Geert Wilders – who attended Trump’s Republican convention last year – will have helped Merkel convey the message.

Trump is simply clueless about the EU and its complex equilibrium of freely chosen, shared sovereignty

There have already been several attempts to counter Brexit propaganda in Washington. German officials spoke to Mike Pence, the US vice-president, during the Munich conference, pressing him to get Trump to say something positive about the EU rather than continue disparaging it. Trump later told Reuters: “The EU, I’m totally in favour of it.” It was hardly reassuring. And Trump hardly said a word about the EU in his press conference with Merkel.

It’s hard to know how Trump can really have an impact on the EU. Perhaps the US president is so repulsive to Europeans they will find new ways to bind together, rather than let nationalist beggar-thy-neighbour policies win the day.

But there is little doubt Merkel considers it her responsibility to defuse the Europhobic danger coming out of Washington. What she got from Trump in public today was an acknowledgment of “shared values” and “the right of free people to manage their own destiny”. How good a job she has done behind the scenes will soon be tested.