On Thursday morning, Americans woke up to the news that their president had gratuitously insulted the prime minister of Australia and maybe threatened to invade Mexico.

In a call with Australian leader Malcolm Turnbull, Trump reportedly bragged about his election victory and railed against a deal the Obama administration had struck with the Australian government to take in a small number of refugees currently trying to enter Australia. According to a Washington Post piece published on Wednesday night, Trump then told Turnbull “this was the worst call by far” he’d had with a foreign leader so far, before abruptly cutting the call short.

What happened on the call with Mexican President Enrique Peña Nieto is less clear. On Wednesday evening, the Associated Press reported that Trump had threatened to send US troops into Mexico to deal with the “bad hombres” on the border if Peña Nieto didn’t get the situation under control. Both the White House and the Mexican government subsequently denied that, and later reporting by CNN backed them up, suggesting Trump had merely offered US military assistance to the Mexican military in dealing with “tough hombres.”

Either way, it’s clear Trump used awkward pidgin Spanish in his call with Mexico’s leader.

There’s part of this that’s kind of funny. In both calls, the Post reports, Trump used precious diplomatic time to brag about the size of his crowds on Inauguration Day, which is just a ridiculous thing to do on a diplomatic call with a foreign leader. And of course, the calls aren’t likely, in and of themselves, to destroy America’s relationship with either Australia or Mexico.

But there’s also part of this that’s really, really scary. It shows that Trump is so temperamental and thin-skinned that it’s hard to know when he’ll fly off the rails, even when speaking to a longstanding American ally like Australia or an important neighbor like Mexico.

“None of this is normal,” Dan Nexon, a professor at Georgetown University who studies American grand strategy, says. “It’s not just that the president is apparently acting like a petulant bully with these people. It’s also that it’s for no obvious policy purpose.”

This kind of behavior generates a deep uncertainty on the part of other countries about whether they can trust America — and trust in America is the foundation on which much of the current world order is structured. If Trump continues to behave this erratically, the consequences could be, well, unpredictable — and that’s scary.

Trump’s Australia call would be hilarious if it weren’t so serious

The issue that appears to have set Trump off on his call with the Australian prime minister is a prior US commitment to take in 1,250 refugees currently housed in offshore detention centers near Australia. The conditions on these island detention centers, as my colleague Dara Lind explains, are horrific, so the Obama administration agreed to take in a relatively small number of refugees on basically humanitarian grounds.

Trump, in his call with Turnbull, called this arrangement “the worst deal ever,” and said he was “going to get killed” for abiding by it. He refused to commit unequivocally to accepting the refugees, merely saying it was “my intention” to abide by the deal Obama struck. Later, he tweeted angrily about it (a tweet that suggests, incidentally, that he only just learned about this agreement during his call with Turnbull):

Do you believe it? The Obama Administration agreed to take thousands of illegal immigrants from Australia. Why? I will study this dumb deal! — Donald J. Trump (@realDonaldTrump) February 2, 2017

There are a few things to note about this. The first, and perhaps clearest, is that this is a truly bizarre way to treat a vital ally.

Australia has fought alongside the US in nearly every major war in the past 100 years, including ones like Iraq and Vietnam that many other US allies were (rightly) hesitant to support. It’s a hugely important partner in the current coalition fight against ISIS — with several hundred on the ground in the Middle East contributing to the counter-ISIS campaign.

Australia is also a member, along with the US, Canada, New Zealand, and the United Kingdom, of the so-called Five Eyes alliance, a close-knit intelligence-sharing arrangement. And Australia plays a critical role in America’s contingency plans in the event of war against China, serving as a Pacific base that’s outside the range of China’s dangerous land-based missiles.

Which means that angering the Australians isn’t just rude; it jeopardizes vital US national security interests — especially at a time when Trump’s rhetoric toward China is getting more aggressive and his administration is planning to step up the war on ISIS.

“I could not have imagined Donald Trump crapping on Australia,” Steve Saideman, a political scientist at Ottawa’s Carleton University, says. “Australia, in most ways, could be considered one of the very, very closest of allies.”

The second thing to note is that the import of the call isn’t just limited to Australia. Generally, presidents follow through on promises made by their predecessors. Without this principle, countries have no way of knowing whether they can make durable bargains with the United States.

Trump is blithely calling this into question. Even if he ends up following through on his end of the bargain, publicly questioning it undermines other countries’ faith in the deals they made with past administrations. Countries that thought they could depend on the United States on issues ranging from security to trade might start thinking about the need to look to other partners — like, say, China.

“There’s an old kind of cliché that countries look for signals about what a president will do based on ... early signaling,” Nexon says. “It’s not like you can’t overcome that stuff. But I would think that if you’re an American ally looking at this kind of behavior, contrasting it with reports about [Trump’s] conversations with Putin, you would be wondering how much you can trust the United States.”

Finally, this incident shows how thoroughly Trump’s concerns about immigration and Islam dominate his overall foreign policy thinking.

Many of the refugees in the Australia deal come from the countries covered in Trump’s recent “Muslim ban” — Iraq, Iran, Sudan, Syria, Libya, Yemen, and Somalia. And, of course, that same policy bans all refugee entry for 120 days. According to the Post, Trump actually accused Turnbull of trying to export the “next Boston bombers” to the United States.

Trump’s deep commitment to excluding these people seems to have taken precedence over the need to maintain good relations with a vital American ally.

“The refugees coming from Australia are brown,” Saideman says bluntly. “There’s this racism undercurrent to all of this that probably should not be denied.”

Sure, let’s maybe send US troops to Mexico, why not

Normally, calls between a new president and a foreign leader are pro forma kinds of things. You say hi, exchange a few pleasantries, reaffirm the need for close cooperation on issues of mutual concern, and then hang up the phone.

You don’t start mouthing off about “hombres” with the Mexican president, and suggesting that US troops will soon enter Mexico (either with or without Mexico’s consent, depending on whose reporting you believe). But this awkward conversation with Peña Nieto is looking less like a one-off and more like a pattern with Trump.

Think back to the days shortly after Trump’s win. At the time, Trump was receiving calls from leaders around the world who were calling to congratulate him and talk about his plans for relations with their countries. We didn’t get a lot of details on those calls, but the details we did were super weird.

His call with Pakistani Prime Minister Nawaz Sharif is the clearest example. According to this readout provided by the Pakistani government, which sounded a hell of a lot like a verbatim transcript of the president’s remarks, Trump assured Sharif that “Pakistanis are one of the most intelligent people”:

Prime Minister Muhammad Nawaz Sharif called President-elect USA Donald Trump and felicitated him on his victory. President Trump said Prime Minister Nawaz Sharif you have a very good reputation. You are a terrific guy. You are doing amazing work which is visible in every way. I am looking forward to see you soon. As I am talking to you Prime Minister, I feel I am talking to a person I have known for long. Your country is amazing with tremendous opportunities. Pakistanis are one of the most intelligent people. I am ready and willing to play any role that you want me to play to address and find solutions to the outstanding problems. It will be an honor and I will personally do it. Feel free to call me any time even before 20th January that is before I assume my office. On being invited to visit Pakistan by the Prime Minister, Mr. Trump said that he would love to come to a fantastic country, fantastic place of fantastic people. Please convey to the Pakistani people that they are amazing and all Pakistanis I have known are exceptional people, said Mr. Donald Trump.

This implies, of course, that there are some nations that Trump considers among the least intelligent. This kind of vaguely racialist rhetoric almost directly mirrors the weird “hombres” comment that we saw in the Peña Nieto call.

This is why the initial AP report that seemed to suggest Trump had threatened to invade Mexico was seen as plausible rather than almost certainly a mistake (that, and his longstanding hostility toward America’s southern neighbor).

Trump has a long pattern of continuing to say weird, ad hoc stuff that is awkward and potentially dangerous. His professional staff is either uninterested in making Trump into a more normal president or they’re unable to. Whichever one it is, it illustrates that the way that US foreign policy is being formulated so far has a lot more to do with Trump’s personal impulses than with any sort of adherence to America’s traditional diplomatic stances.

“[This administration] is a kind of barely controlled chaos from a policy perspective,” Nexon says.

The terrifying uncertainty of Donald Trump

The common thread between the Australia and Mexico calls, above all else, is uncertainty. Trump acts in such a strange way, so alien from the way American diplomacy has been conducted for basically its entire history, that foreign leaders simply don’t know what to expect from the United States anymore.

“I have taken to calling Trump an uncertainty engine,” Saideman says. “And that is really bad.”

Broadly speaking, US foreign policy for the past 70 years has depended on consistency. America has made formal alliances, most notably NATO, that work because US allies have faith that the United States will come to their aid if attacked. The dollar is the world’s reserve currency, underwriting the global financial system, because nations the world over have faith in American stability. Dozens of countries count on America to keep the peace globally and keep trade routes open, so they mostly go about their own business.

Under Trump, though, it’s just not clear whether the United States will remain committed to this core approach to the world. The president is so temperamental, so willing to threaten to renege on past agreements if he doesn’t see an upside in them, that trust in America’s traditional commitments is fraying. The starkest examples of this are Trump’s threats to back out of defending Baltic NATO allies if they are attacked by Russia and to leave the World Trade Organization if he thinks trade deals aren’t getting any better for the US.

But this may not be an accident. Indeed, Trump seems to see unpredictability as a strategic virtue.

“We must as a nation be more unpredictable,” Trump said in a summer 2016 speech to the Center for the National Interest. “We are totally predictable. We tell everything. We’re sending troops. We tell them. We’re sending something else. We have a news conference. We have to be unpredictable. And we have to be unpredictable starting now.”

These strange, angry phone calls with foreign leaders might not be quite as disturbing if they happened in isolation. But given this background, they give American allies the world over more evidence that they need to be thinking about a world outside the American-led global order.

It’s impossible to predict what this means in practice. But foreign policy experts have floated scary hypotheticals ranging from US allies cozying up with China to Japan developing nuclear weapons. (During the campaign, Trump seemed to actually encourage the latter.) If you can’t trust America to provide for your security, the thinking goes, you might just have to do it yourself.

None of this will likely happen immediately, and it’s not inevitable. The Trump administration has time to reverse the perception of instability it has created, and to firm up its commitment to the normal international order. But there’s no guarantee Trump is actually going to do that — and these calls are a sign that he may not. The consequences could potentially be catastrophic.

“The United States has been the bedrock for the international order that provided peace and prosperity, with some bumps along the way, for 70-plus years,” Saideman says. “And now that bedrock has become liquefied, as though there was an earthquake. And the international order is resting on ... on what?”