I’ve given up on trying to find a method in the madness of Donald Trump’s tweets. But his recent attack on the German government at least makes political sense. Under fire over the inhumane treatment of immigrant children at the US border, Trump is telling his supporters that an overly harsh treatment of illegal immigrants is surely better than the chaos Angela Merkel’s open-door policy has created.

This is what Trump tweeted: “The people of Germany are turning against their leadership as migration is rocking the already tenuous Berlin coalition. Crime in Germany is way up. Big mistake made all over Europe in allowing millions of people in who have so strongly and violently changed their culture!” And then: “We don’t want what is happening with immigration in Europe to happen with us!”

Now I hate to say this, and mainstream media in Germany have been lambasting Trump’s interference in German politics, but Potus has a couple of points.

Donald J. Trump (@realDonaldTrump) We don’t want what is happening with immigration in Europe to happen with us!

Merkel’s “already tenuous” coalition has indeed just weathered a storm that threatened to bring down the government. Once again the two sister parties, Merkel’s CDU and the Bavarian CSU, have been fighting over immigration. The interior minister, Horst Seehofer, until recently leader of the CSU, wants tighter controls at the German border. Merkel isn’t against a stricter border regime, but wants this to be part of a European agreement, which she hopes to achieve at an EU summit at the end of this month.

Seehofer wants to turn back any refugee who is already registered in another EU country or who has already applied for asylum in Germany and been refused. In fact, he threatened to order the federal police to implement this rule – which is consistent with German asylum law – without asking the chancellor, unless she endorsed his position by Monday.

Play Video 1:30 Donald Trump : 'The United States will not be a migrant camp' – video

The German commentariat wrote themselves into a Wagnerian Götterdämmerung frenzy. However as I write this, on Monday evening, Seehofer has backed down. As she so often does with the men who challenge her, Merkel gave him just enough rope to hang himself. It seems to have dawned on Seehofer that if Germany sends back refugees who are registered elsewhere, a country such as Italy with its new anti-immigrant government might stop registering them, as it did at the height of the refugee crisis in 2015. Unilateral action would also anger our Austrian neighbour, who would be saddled with most of the migrants Germany turns back.

Here’s the paradox: Italy and Austria both have anti-immigrant governments. Ideologically, they are on the same page as Seehofer’s CSU. But that is precisely the reason they are not going to pick up the tab if Germany tightens its border regime. Merkel has common sense on her side when she argues that there has to be a European fix. So Seehofer “graciously” gave her two more weeks, upon which Merkel stated that if her minister acted unilaterally, she would tell him where to get off.

Can Catholic crosses keep the far right at bay in multicultural Bavaria? | Alan Posener Read more

Good stuff. But – and Trump is right here, again – the coalition squabble has led to sinking approval ratings for the government. And though Trump is obviously wrong when he says that migrants have “violently changed” the culture of Germany and that crime is “way up”, public sentiment at least appears to have changed in recent weeks. The shocking case of a 14-year-old Jewish girl, Susanne Feldman, who was raped and murdered, has provoked alarm, even among supporters of an open immigration policy. The prime suspect is a refugee who fled back to Iraq in the wake of her disappearance. He has since been arrested and has reportedly confessed to the crime. There has been deep disquiet over antisemitic attacks by Muslims in Germany, and this murder – though there is no evidence it was racially motivated – has shamed and angered the nation.

Trump’s criticism and Seehofer’s insubordination might strengthen Merkel’s hand and bring the EU closer to a common policy on migration and refugees. Whether this will be enough to head off the frustration that has spread far beyond the populist fringe is another matter.

• Alan Posener, a German blogger, writes for Die Welt and Welt am Sonntag