Both were forced to defend negative perceptions about leadership and trust that have dogged their campaigns.

Appearing consecutively in an NBC town hall forum, one stressed experience and judgment borne of that experience, while demonstrating her command of policy detail. The other relied on gut instinct and a desire to bring an outside-the-box approach to thorny problems, even as he relied on broad generalities.

WASHINGTON — Hillary Clinton and Donald Trump showcased widely different styles and approaches to the job of commander in chief Wednesday night, attempting to prove their leadership qualifications on national security as the election enters its final sprint toward November.


Clinton defended her handling of classified information as secretary of state and her support for US military intervention in Libya, adding that voters should judge her "on the totality of my record.''

Trump crowed about the virtues of Russian President Vladimir Putin — "He does have an 82 percent approval rating, according to the different pollsters," he said — and shrugged when pressed about why he often compliments the leader of one of the chief adversaries of the United States.

"When he calls me brilliant, I'll take the compliment. OK?" he said. "If he's going to say great things about me, I'm going to say great things about him."

The hourlong forum provided a tantalizing preview of the highly anticipated first real debate between Trump and Clinton, slated to take place Sept. 26. They spoke from the same stage on Wednesday night, but never did the two appear together, even to shake hands.

The event, which aired on NBC and MSNBC, was moderated by Matt Lauer and held at New York's Intrepid Sea, Air, and Space Museum. Trump won the coin toss and opted to go second.

Donald Trump. Evan Vucci

Nearly half of Clinton's allotted time was spent dissecting two of her admitted mistakes: setting up a private e-mail server and voting in favor of the war in Iraq.


"It was a mistake to have a personal account. I would certainly not do it again," she said of the server.

She was pressed on her knowledge of the classified system, with one former military officer asking why she wasn't penalized in a way that he would have been if he committed similar offense.

"I communicated about classified material on a wholly separate system. I took it very seriously."

"I did exactly what I should have done," she added. "I take it very seriously. Always have, always will."

Clinton also said she should not have voted for the war in Iraq — and boldly pledged, "We are not putting ground troops into Iraq ever again, and we're not putting them into Syria."

But she also said Trump had been dishonest on the issue, questioning his judgment and candor. Trump was also in favor of the Iraq War initially before opposing it – something he often leaves out and which Lauer did not probe him on later when Trump said, "I was totally against the war in Iraq."

"I have taken responsibility for my decision. He refuses to take responsibility for his support," Clinton said. "That — that is a judgment issue."

When asked whether she could promise the public that there would be no domestic terror attacks in her four years in office, Clinton responded, "I'm not going to promise something that I think most thinking Americans know is going to be a huge challenge."


Clinton, who took steps toward the ultimate deal to prohibit Iran from developing nuclear weapons, defended that pact as making "the world safer'' while emphasizing Iran still poses a menace in the region.

"I think we have enough insight into what they're doing to be able to say we have to distrust but verify. What I am focused on is all the other malicious activities of the Iranians — ballistic missiles, support for terrorists, being involved in Syria, Yemen, and other places, supporting Hezbollah, Hamas.''

The forum focused on national security and veterans issues comes amid heightened anxiety over terrorism, with voters often saying national security is at the forefront of their minds heading down the crucial two-month stretch before the election.

Clinton pointed to her experience on the world stage and her tenure as secretary of state, which she uses as a contrast to Trump's more shoot-from-the-hip rhetoric.

Trump has adopted more of a chest-thumping world view — vowing to "bomb the hell out of ISIS" — while simultaneously talking up "diplomacy without destruction."

"I have a common sense approach to the various issues you're talking about," Trump said at one point as he several times referenced his campaign slogan: Make America Great Again.

Asked to name the most important quality for a president, Clinton seemed to draw a contrast with Trump: ''Steadiness, an absolute rock steadiness, mixed with strength to make the hard decisions,'' she said.


A Wall Street Journal/NBC News poll conducted in June found that 28 percent said that national security and terrorism was the most important issue for the government to address, while 22 percent said job creation and economic growth.

Both candidates were asked to keep comments about their opponents at a minimum, something that Clinton generally abided by, alluding to Trump three times as "my opponent'' but never by name. Trump referenced Clinton by name in most of his answers.

"She's been there 30 years. We need change, Matt," Trump said. "We have to have it and we have to have it fast."

Trump was asked what experiences he has that qualifies him as commander in chief, and he responded, "I built a great company. I've been all over the world. . . . I have great judgment. I have good judgment. I know what's going on."

One former military member pushed Trump to speak with more specificity how he would defeat the Islamic State and what would come next.

Trump gave a meandering answer recounting what he considers past mistakes in US policy without describing his plans. He said that if the United States had seized oil in the region the Islamic State would have never flourished.

"We should be there. But if we're going to get out, take the oil," he said. "If we would have taken the oil, we wouldn't have ISIS."

But still, he refrained from specifics. ''I have a very substantial chance of winning,'' he said. ''If I win, I don't want to broadcast to the enemy exactly what my plan is.''


Trump also said that during the recent classified briefings he has started to receive, "There was one thing that shocked me."

He also claimed that the government officials briefing him said that President Obama did not follow "what our experts said to do."

He provided no evidence but said, "I am pretty good with the body language. I could tell they were not happy."

Trump was also asked about sexual assault in the military. He said it has become a rampant problem, but that it should be solved by a more forceful military court system.

Lauer briefly brought up something that Trump tweeted in 2013, when he wrote that there were 26,000 unreported sexual assaults and only 238 convictions. "What did these geniuses expect when they put men & women together?"

"Something has to happen," Trump said. "Nobody gets prosecuted. . . . When you have somebody that does something so evil, so bad as that, there has to be consequences."

Earlier on Wednesday, Trump slammed Clinton as being reckless as he outlined a skeletal plan to bulk up American military spending. He went through a litany of issues he had with Clinton — whom he once praised — and said that nearly every pocket of the world that she got involved with is now unstable.

"She's trigger-happy and very unstable," he said. "She's totally unfit to be our commander in chief."

Matt Viser can be reached at matt.viser@globe.com.