President Obama used a wide-ranging and at times sharply political speech at the Veterans of Foreign Wars convention to defend his Iran deal as a way to avoid sending troops into unnecessary battles, and took a shot at supporters of the Iraq war in the process.

"I'm hearing echoes of some of the same policies and mindset that failed us in the past," Obama told the crowd gathered in Pittsburgh for the convention, "some of the same folks who were so quick to go to war in Iraq … [who] said it would only take a few months."

Rushing into war "without thinking through the consequences" and "spreading our military too thin played into the hands of our adversaries," Obama said.

"Who paid the price? Our men and women in uniform," he said to applause.

But it was one of the few hearty rounds of applause Obama received in a speech defending his foreign policy and record on military spending and veterans' healthcare before one the largest and oldest veterans groups in the country.

On the Iran deal, Obama asserted that it would "cut off every single one of Iran's pathways to a nuclear weapon," and said "real leadership also means using our policy wisely."

Although he didn't defend his controversial decision to seek United Nations approval for the Iran agreement before allowing Congress to weigh in, he made his preference for building international support instead of unilateral U.S. action clear — both for the Iran deal and in the fight against the Islamic State of Iraq and Syria.

"We're stronger when we stand with allies and partners," he said. "It's a force multiplier."

He broadly stated without providing any new signs of success that the United States would prevail in its fight against the Islamic State. "We will degrade and ultimately destroy this barbaric coalition," he said.

The president warned Islamic State sympathizers in the U.S. against attempts to plot and carry out domestic terrorist attacks on the nation's homeland. "We will not give in to fear, you will not change our way of life, you will not divide Americans," he said.

He read out the names, one-by-one, of the four Marines and one Navy sailor killed in last week's shootings in Chattanooga, Tenn., recounting some highlights of their personal lives and service overseas.

"Our nation endures because people like you put on the uniform and help keep this nation free," he said.

Obama also used the speech to criticize Republicans on spending, and said the GOP has insisted that budget sequestration could be done without weakening spending on veterans.

"Some of the reckless budget cuts under the name of sequestration … that's not the way to keep our armed forces ready" or deliver benefits to the troops and their families, he said.

"These mindless cuts have to end," he said, adding that he will veto any "bill that locks in" sequestration.

The president reserved the end of the speech for dealing with the myriad problems that have plagued the Veterans Affairs Department over the last two and a half years.

He gave a ringing endorsement of VA Secretary Bob McDonald and his efforts to cut long wait times and backlogs for vets seeking medical care.

"I made clear I want those problems fixed," Obama asserted, noting that McDonald has ushered in new leadership and is working to ensure that "whistleblowers are protected instead of punished."

Opening more clinics and providing veterans in rural areas access to private doctors are just some of the changes the VA has made since the scandal broke last year. The backlog, he said, has been cut by 80 percent and "on average" veterans are now waiting just a few days for an appointment.

Republican critics of Obama's record on veteran issues argue that he has been slow to respond even after the media, including the Washington Examiner, exposed several VA shenanigans to cook the books and avoid dealing efficiently with backlogs.

"One out of every three veterans waiting for care at the VA has already died, and President Obama still doesn't have a plan to change the culture at the VA," said Cory Fritz, spokesman for Speaker John Boehner, R-Ohio.

"Instead of hollow platitudes, the president needs to join the House Republicans in working to deliver accountability and reform for our veterans," he added.

To date, only two VA officials have been fired for the waiting list scandal, Republicans point out. The House next week plans to take up the VA Accountability Act, which will give the secretary the authority to fire any VA employee for misconduct.

Obama acknowledged that more work needs to be done, listing one of the top remaining priorities as continuing to work on ending veteran homelessness and protecting veterans from predatory lenders, he said.