Democratic presidential nominee Hillary Clinton and her Republican opponent Donald Trump answered questions on national security and foreign policy Sept. 7 during a “commander-in-chief forum” on NBC News. (Video: NBC News/Photos: Melina Mara/Post, Mike Segar/Reuters)

Democratic presidential nominee Hillary Clinton and her Republican opponent Donald Trump answered questions on national security and foreign policy Sept. 7 during a “commander-in-chief forum” on NBC News. (Video: NBC News/Photos: Melina Mara/Post, Mike Segar/Reuters)

Donald Trump defended his admiration for Russian President Vladi­mir Putin at a forum here Wednesday focused on national security issues, even suggesting that Putin is more worthy of his praise than President Obama.

“Certainly, in that system, he’s been a leader, far more than our president has been a leader,” Trump said. “We have a divided country.”

The Republican presidential nominee said that an alliance with Russia would help defeat the Islamic State, and when asked to defend some of Putin’s aggressions on the world stage, he asked, “Do you want me to start naming some of the things Obama does at the same time?”

Trump also said he appreciated some of the kind words Putin has had for him. “Well, I think when he calls me brilliant, I think I’ll take the compliment, okay?”

Trump and Democratic rival Hillary Clinton made back-to-back appearances at an event that sounded the starting gun for the final stretch of the presidential race and offered a potential preview of what are expected to be rollicking debates in the weeks to come.

On Sept. 7, during a town hall event hosted by MSNBC, Republican presidential candidate Donald Trump stated he would have “a good relationship” with Russian president Vladimir Putin. It wasn’t the first time he made that claim. (Adriana Usero/The Washington Post)

Clinton offered herself as a model of “absolute rock steadiness” on foreign policy, and Trump promised to be a disruptive force for improvement, saying that under Obama even the military’s generals have been “reduced to rubble.” Trump suggested he could replace some of the military brass.

Clinton appeared guarded, even stilted, as she navigated tough questions about her use of a private email server as secretary of state and her vote for the Iraq war in the Senate, but Trump showed no such restraint with a series of controversial statements.

He reaffirmed his view that having men and women serve alongside one another is the root of the military’s sexual-assault problem. He said recent intelligence briefings have convinced him that Clinton and other Obama administration officials did not heed the advice of experts. And he praised Putin, noting among other things the Russian president’s “82 percent approval rating.”

Ahead of Wednesday’s forum, Trump delivered a speech in Philadelphia in which he called for a robust expansion of U.S. military capabilities and an end to budget sequestration on defense spending.

“As soon as I take office, I will ask Congress to fully eliminate the defense sequester and will submit a new budget to rebuild our military. It is so depleted. We will rebuild our military,” Trump said during the speech at the Union League of Philadelphia. “This will increase certainty in the defense community as to funding and will allow military leaders to plan for our future defense needs.”

Trump’s address represented his most substantive and comprehensive plan on national security to date — part of an ongoing effort to assuage doubts that he lacks a sufficient understanding of policy issues to assume the presidency. Reading from prepared remarks, Trump spoke about modernizing the ­military’s equipment and increasing the size of the armed forces.

Clinton, who has also advocated ending the defense sequester, spent the earlier part of her segment of the forum defending herself regarding the email controversy and her handling of classified material, which she insisted she did responsibly.

1 of 60 Full Screen Autoplay Close Skip Ad × What Donald Trump is doing on the campaign trail View Photos The GOP presidential nominee is out on the trail ahead of the general election in November. Caption The GOP presidential nominee is pressing his case ahead of Election Day. Nov. 7, 2016 Donald Trump speaks during a campaign event at SNHU Arena in Manchester, N.H. Jabin Botsford/The Washington Post Buy Photo Wait 1 second to continue.

And she acknowledged that her vote as a senator from New York to authorize the use of military force in Iraq was a mistake. But Clinton said she had learned from the decision and chided Trump for saying he had opposed the war from the outset despite statements to the contrary.

“I have taken responsibility for my decision,” Clinton said. “He refuses to take responsible for his support.”

The forum, broadcast by MSNBC and NBC stations and hosted by Matt Lauer of the “Today” show, was billed as a discussion of the most important issues facing the nation’s next commander in chief. Clinton and Trump appeared separately before a live audience of active-duty military personnel and veterans — a group that traditionally skews Republican — at the Intrepid Sea, Air & Space Museum in New York. The event was hosted by the Iraq and Afghanistan Veterans of America.

The forum was scheduled ahead of three standard debates between the two major-party presidential nominees, the first of which is scheduled for Sept. 26 at Hofstra University in Hempstead, N.Y.

Clinton and Trump were asked early in their segments not to attack each other — and both drew admonishments from Lauer for ignoring his request.

Clinton, for example, chided Trump for proposing a ban on Muslims entering the country, saying, “That is not going to help us succeed in defeating ISIS.”

And Trump accused Clinton of having a “happy trigger,” a suggestion that she is too eager to insert the United States into international conflicts.

The United States’s involvement in Iraq was a prominent part of both segments.

Clinton argued that the war was one area where she and Trump shared positions. “I think that the decision to go to war in Iraq was a mistake, and I have said that my voting to give President Bush that authority was, from my perspective, my mistake,” Clinton said. “There was a mistake. My opponent was for the war in Iraq. He says he wasn’t; you can go back and look at the record. He supported it.”

Clinton vowed that, if she is elected president, “we are not putting ground troops into Iraq ever again.”

As he has in the past, Trump insisted that he did not support President Bush’s invasion in 2003, despite evidence to the contrary.

The businessman also argued that taking Iraq’s oil would have prevented the rise of the Islamic State terrorist group in the Middle East.

“I’ve always said, shouldn’t be there, but if we’re going to get out, take the oil,” he said. “If we would have taken the oil, you wouldn’t have ISIS, because ISIS formed with the power and the wealth of that oil. “

During his segment, Trump also defended a Twitter message he posted three years ago that stated the estimated number of unreported sexual assaults in the military and then mused: “What did these geniuses expect when they put men & women together?”

“Well, it is, it is a correct tweet,” Trump said when asked about the tweet by Lauer. “There are many people that think that that’s absolutely correct. . . . Well, well, it’s happening, right? And, by the way, since then, it’s gotten worse.”

When asked what he had learned from his intelligence briefings since becoming the Republican nominee, Trump said that Obama and others have not done “what our experts said to do.”

“And I was very, very surprised,” he said. “In almost every instance, and I could tell, I’m pretty good with the body language. I could tell, they were not happy. Our leaders did not follow what they were recommending.”

Trump said he was not a fan of the Russian system of government but predicted continued good relations with Putin, saying: “I think I would have a very, very good relationship with Putin, and I think I would have a very, very good relationship with Russia.”

Trump denied that mutual admiration between him and the Russian leader would benefit Russia in its dealings with the United States. “It’s not going to get him anything,” Trump said. “I’m a negotiator.”

During her segment, Clinton defended her handling of classified information, insisting that she never sent or received any documents on her private email server that were properly marked as classified.

Clinton was pressed with questions on the issue almost as soon as the forum began.

“Classified material has a header that says ‘top secret,’ ‘secret,’ ‘confidential,’ ” Clinton said. “None of the emails sent or received by me had such a header.”

The issue has bedeviled her campaign from the start, and one of the questions about it came from a veteran, who noted that if he had handled classified information in a way that was not permitted, he would have been prosecuted and jailed.

“I communicated about classified material on a wholly separate system,” Clinton said. “I took it very seriously.”

A poll released Wednesday showed Trump with a sizable lead among active-duty personnel and veterans.

Trump leads Clinton by 19 points — 55 percent to 36 percent — among voters who are serving or have served in the U.S. military, according to the NBC News/SurveyMonkey tracking poll.

That’s a somewhat larger margin that two other recent national polls of military veterans since the Democratic convention. Trump led Clinton by 14 points in a Fox News poll and 11 points in a McClatchy-Marist poll.

The demographics of military veterans align closely with Trump’s strongest sources of support. More than 9 in 10 are men, and about 8 in 10 are white. In 2012, among military veterans, Republican Mitt Romney bested Obama by about 20 points, according to exit polls.

The run-up to Wednesday’s forum featured intense jockeying between Clinton and Trump over which candidate is better suited to lead the military — with each sharply questioning the other’s temperament and judgment. During a campaign stop Tuesday in Tampa, Clinton said Trump had “no clue” about national security issues.

Just minutes before the forum was to begin, Clinton tweeted, “Donald Trump has proven over and over again that he’s unfit to be our Commander-in-Chief.”

On Tuesday, Trump announced that he has been endorsed by 88 retired senior military officials. Not to be outdone, Clinton released a list Wednesday showing the support of 95 retired generals and admirals, more than any recent nonincumbent Democrat, her campaign said. Meanwhile, Clinton noted that Trump’s endorsement figure was more than 400 shy of the last Republican nominee, Mitt Romney.

DelReal and Gearan reported from Washington. Scott Clement, Karen DeYoung, Thomas Gibbons-Neff, Jenna Johnson, Abby Phillip and Missy Ryan in Washington contributed to this report.