President Obama used his Thursday commencement address at the Air Force Academy to dispute his critics by saying America is great already, and defend his foreign policy and domestic economic record against attacks from Donald Trump and the Republican Party.

Despite criticism from Trump and Republicans that the U.S. never rebounded from the Great Recession, and that terrorism has thrived around the world on his watch, Obama told the graduating Air Force cadettes that Americans are "blessed to be living in the most peaceful and prosperous era in human history." That statement that contradicts claims of some of his own top generals that the U.S. faces more threats than ever before.

Obama did acknowledge that terrorist networks slaughter "the innocent and plot against our nation," and noted Russia's aggression in the Ukraine and China in the South China Sea. Still, he said the violence that the nightly news depicts doesn't compare to the killings of millions during the world wars.

"Wars between nations are increasingly rare, more people live in democracies, more than one billion people have been lifted from extreme poverty," he said. "From the Americas to Africa to South East Asia, there is a new generation of young people connected by technology and ready to make their mark. They look up to America, they aspire to be our partner."

"That's the progress and hope we have to build on," he said.

While he never named Donald Trump, he told the graduating Air Force cadettes that it's important for them to realize the importance of "evidence and facts and judgment," and said it's important to realize that the "United States of America remains the most powerful nation on earth and a force for good."

While Trump has said world leaders no longer respect the United States after Obama's tenure, Obama claimed just the opposite.

He argued that "our standing in the world is higher … I see it in my travels from Havana, Berlin to Ho Chi Minh City," where crowds of thousands of cheering people greeted him in the streets waving American flags during his visit just last week.

"Make no mistake: The United States is better positioned to lead the 21st Century than any other nation," he said.

"Our military is by a mile the strongest in the world," he added, noting that after the wars in Afghanistan and Iraq the U.S. is engaged in a "normal and necessary" drawing down of our military.

Obama provided a lengthy response to Trump's 'America first' foreign policy and his vow to retool NATO and the United Nations, and warned against the mistake of shirking "the mantle of leadership" and "giving in to isolationism."

As Americans, he said, need to keep working with international partners. He said one of the most effective ways to do that is to enter into more international treaties, not fewer, as Trump has argued.

But it's also foolish, he said, to become too interventionist and start wars that overextend the U.S., like Vietnam and the war in Iraq.

"History is littered with the ruins of civilizations that have overextended themselves… so we have to chart a smarter path," he said.

Part of leading "wisely," he said, is recognizing threat in a serious way rather than "panicking."

"When we panic, we don't make good decisions," he said.

But he also stressed that under his watch, several terrorist leaders have been killed or captured, and listed off the names of several. "All gone… If you target Americans, we will find you and justice will be done," he said to applause.

He also talked about some of the most controversial foreign policy decisions of his presidency, and how tough the decision against launching airstrikes in Syria was after Syrian Leader Bashar Assad used chemical weapons on rebels.

But he defended the decision and its results as far more effective than launching military strikes.

"Because we seized a diplomatic option backed by our threat of force, nations came together and we accomplished far more than military strikes every could have," he said. "All of Syria's declared chemical weapons were successfully removed."

Whenever possible, he said, the U.S. has a "responsibility" to build coalitions and partnerships, not simply go it alone.

"On a whole lot of global problems the U.S. shouldn't bare the entire burden of global security by itself – others have to step up," he said.

Obama acknowledged some domestic challenges as well, including with the economy and "our politics." But he encouraged the graduating class to "look around" for evidence of the country's greatness. And along the way, he threw in support for his efforts on issues like immigration.

"We have the world's strongest economy … our values of freedom, equality and opportunity – those values inspire people everywhere, including immigrants who come here ready to work and integrate and help renew our country," he said.

Obama also seemed increasingly aware of the less than eight months he has left in the Oval Office. He thanked his Air Force family for taking care of him, always being on time and never losing his luggage when he travels on Air Force One.

"I'm really going to miss Air Force One, and the incredible pilots I've gotten to know," he said.