America just got its first real look at Commander in Chief Donald Trump. It wasn’t a pretty sight.

The signal moment came late in the debate. Hillary Clinton accused Trump of being “very dismissive” of American alliances, such as the North Atlantic Treaty Organization (NATO), an alliance that obligates the United States to defend all other members if any of them is attacked. Trump responded by saying, “I'm all for NATO.”

And then he kept talking:

Just to go down the list, we defend Japan. We defend Germany. We defend South Korea, we defend Saudi Arabia. We defend countries. They do not pay us what they should be paying us, because we are providing tremendous service and losing a fortune. We lose on everything. I say who makes these? We lose on everything. What I said, it's very possible that if they don't pay a fair share, because this isn't 40 years ago where we could do what we're doing. We can't defend Japan, a behemoth selling us cars by the millions.

The first issue here is basic coherence. The NATO agreement isn’t “we’ll defend them if they pay enough.” It’s that we’ll defend them as long as the treaty exists. Trump’s position is that he’s for NATO but also against it. He seemed to have literally no understanding that he just flagrantly contradicted himself on the most important alliance agreement in the world.

But even more fundamentally, Trump doesn’t realize how dangerous his policy is. The core purpose of NATO is to deter an attack on NATO members by a stronger power, most notably Russia. The basic idea is that Russia wouldn’t want to risk a war with the United States and other NATO powers, so it wouldn’t invade even small NATO countries like Estonia.

This entire system only works if Russia believes the United States is unconditionally committed to the NATO alliance. Trump, by suggesting he’s maybe kinda sorta not into NATO, is undermining this — making it more likely that Russia might risk invading an American ally, and hence more likely that the US could be actually drawn into a shooting war with Russia.

Trump’s foreign policy section was his most disastrous, and his most important

Much press coverage of the debate will focus heavily on the number of times Trump interrupted Clinton, the apparent laughter in the debate hall when the GOP nominee praised his own temperament, and Clinton’s harsh denunciation of Trump for spreading a “racist lie” by falsely asserting that President Obama wasn’t born in the US.

Trump’s foreign policy views might not get as much attention, but they should. Many of the things the self-proclaimed billionaire has said he would do on the domestic front — from slashing taxes to repealing Obamacare to deporting millions of undocumented immigrants — would require congressional approval or could at least in theory be blocked by the Supreme Court.

When it comes to his powers as commander in chief, by contrast, a President Trump would be largely free to act without constraint. Trump would be able to ramp up the war against ISIS without going to Congress and could effectively lift the existing sanctions on Russia on his own.

But throughout the debate, Trump repeated old lies (opposing the Iraq War before it started), advocated measures that would have been illegal to carry out (seizing Iraq’s oil), and seemed to simultaneously say that he wouldn’t mount a nuclear first strike against an American enemy and that he didn’t want to take that option off the table.

More broadly, he offered a clear illustration of his core foreign policy belief: All issues should be seen as business transactions, with a Trump administration choosing which allies to support — and which enemies to confront — based solely on its assessment of the economic costs and benefits.

Trump also refused to criticize Russian President Vladimir Putin, despite the US intelligence community’s near-unanimous belief that Moscow hacked emails from the Democratic National Committee in an effort to embarrass Clinton and harm her electoral prospects. The cyberattack, Trump said, could just as easily have been carried out by China or by “someone sitting on their bed that weighs 400 pounds.”

These types of answers are familiar to anyone who followed the Republican primaries. What this latest debate showed, though, is that Trump has learned nothing — that he hasn’t even bothered to develop a better or more sophisticated view of foreign policy, despite being one election away from the most powerful office in the world.

If this was a commander in chief test, Trump failed.

Trump has no idea how to handle terrorism

Throughout this entire election cycle, Trump has refused to outline even the barest thread of a plan for fighting ISIS, arguing that it would give away secrets to the enemy. It’s a transparent con, but one he expects the American public to fall for — and one he repeated at Monday’s debate.

The closest he got to being specific about fighting terrorism was his proposal, yet again, that the United States should have taken “the oil.” If we stole Iraq’s oil deposits after the 2003 invasion, his argument goes, then ISIS wouldn’t have been able to fund its operations:

As I've been saying for a long time, and I think you'll agree, because I said it to you once, had we taken the oil, and we should have taken the oil, ISIS would not have been able to form either, because the oil was their primary source of income. And now they have the oil all over the place, including the oil, a lot of the oil in Libya.

This is untrue in every particular. Prior to June 2014, ISIS’s oil revenue came from Syria, so annexing Iraqi oil wouldn’t have stopped the group from forming. ISIS doesn’t control any oil in Libya. And its oil holdings globally are actually decreasing, owing in part to coalition bombings.

But it’s important not to lose track of the basic issue here: Trump is advocating war to steal another country’s resources, which is illegal under international law. The word for this is “colonialism.”

Trump’s policy is so outlandish, so beyond the pale of what we expect from a plausible presidential candidate, that it’s hard to take it seriously. Yet Trump has been calling for it for years. This is not a normal thing for someone in his position to say, much less believe, yet here we are.

Trump’s WTF answer on nuclear weapons

One of the things about being president is that, legally speaking, you’re pretty free to fire off nuclear weapons. So one of the most important questions in deciding on a president is whether you think someone has the character and basic knowledge to steward America’s vast nuclear arsenal.

To try to get at this issue, moderator Lester Holt asked Trump about “no first use”: the idea that the US should swear off launching a nuclear strike against an enemy unless it has been attacked with nukes first.

This is an interesting, complicated, and very important nuclear policy debate, with credible experts on both sides. Trump’s answer revealed that he had no idea what it was about. Indeed, he somehow managed to say two completely opposite things about the policy in the same answer:

I'd like everybody to end it, just get rid of it, but I would certainly not do first strike. I think once the nuclear alternative happens, it's over. At the same time, we have to be prepared. I can't take anything off the table.

So “I would certainly not do first strike,” but “I can’t take anything off the table.”

Those are opposite things. The whole point of a no-first-strike policy is taking a first strike off the table. That means Trump literally had never heard of the no-first-use debate, or had never thought about it enough to have an actual opinion on it.

That would be fine if Donald Trump were a reality show host. But he’s running for president, so it’s not.

Trump still can’t tell the truth about the Iraq War

Earlier this year, NBC host Matt Lauer was widely panned for allowing Trump to lie about his support for the Iraq War, which he claims to have opposed despite clear evidence to the contrary.

On Monday, Holt bluntly called Trump out for the falsehood. Trump, to put it generously, didn’t have a convincing — or coherent — defense. It’s a lengthy exchange that’s worth reading in full, if only to appreciate Trump’s slightly surreal attempt to use Fox News personality Sean Hannity as a shield:

HOLT: Mr. Trump, a lot of these are judgment questions. You had supported the war in Iraq before the invasion. What makes your... TRUMP: I did not support the war in Iraq. HOLT: In 2002... TRUMP: That is a mainstream media nonsense put out by her, because she — frankly, I think the best person in her campaign is mainstream media. HOLT: My question is, since you supported it... TRUMP: Just — would you like to hear... HOLT: ...why is your — why is your judgment... TRUMP: Wait a minute. I was against the war in Iraq. Just so you put it out. HOLT: The record shows otherwise, but why — why was... TRUMP: The record does not show that. HOLT: Why was — is your judgment any... TRUMP: The record shows that I'm right. When I did an interview with Howard Stern, very lightly, first time anyone's asked me that, I said, very lightly, I don't know, maybe, who knows? Essentially. I then did an interview with Neil Cavuto. We talked about the economy is more important. I then spoke to Sean Hannity, which everybody refuses to call Sean Hannity. I had numerous conversations with Sean Hannity at Fox. And Sean Hannity said — and he called me the other day — and I spoke to him about it — he said you were totally against the war, because he was for the war. HOLT: Why is your judgment better than... TRUMP: And when he — excuse me. And that was before the war started. Sean Hannity said very strongly to me and other people -- he's willing to say it, but nobody wants to call him. I was against the war. He said, you used to have fights with me, because Sean was in favor of the war. And I understand that side, also, not very much, because we should have never been there. But nobody called Sean Hannity. And then they did an article in a major magazine, shortly after the war started. I think in '04. But they did an article which had me totally against the war in Iraq. And one of your compatriots said, you know, whether it was before or right after, Trump was definitely — because if you read this article, there's no doubt. But if somebody — and I'll ask the press — if somebody would call up Sean Hannity, this was before the war started. He and I used to have arguments about the war. I said, it's a terrible and a stupid thing. It's going to destabilize the Middle East. And that's exactly what it's done. It's been a disaster. HOLT: My reference was to what you had said in 2002, and my question was... TRUMP: No, no. You didn't hear what I said.

Actually, Trump has that backward. Holt — and the tens of millions of Americans watching the debate — heard exactly what he said. The problem isn’t that Trump failed to articulate a coherent worldview or lay down clear signposts for how he would govern as commander in chief. The problem is that he did.

Watch: Lester Holt presses trump on Iraq War