"You are the first class to graduate since 9/11 who may not be sent into combat in Iraq or Afghanistan," he said. "When I first spoke at West Point in 2009, we still had more than 100,000 troops in Iraq."
At the time, Obama said, the U.S. military was preparing to surge in Afghanistan, counterterrorism efforts were focused on al-Qaida's core leadership, and America was just beginning a long climb out of the worst economic crisis since the Great Depression.
Four and half years later, Obama noted, the landscape has changed, with U.S. troops out of Iraq and the war in Afghanistan winding down.
"Al-Qaida's leadership in the border region between Pakistan and Afghanistan has been decimated, and Osama bin Laden is no more," he said. By most measures, Obama said, America has rarely been stronger, relative to the rest of the world.
"Think about it -- our military has no peer," he said. "The odds of a direct threat against us by any nation are low, and do not come close to the dangers we faced during the Cold War."
U.S. values inspire leaders in parliaments and new movements in public squares around the globe, Obama said, and when a typhoon hits the Philippines, or girls are kidnapped in Nigeria, or masked men occupy a building in Ukraine, the world looks to America for help.
"The United States is, and remains, the one indispensable nation," Obama said. "That has been true for the century past, and will likely be true for the century to come."
The President cautioned that the world is "changing with accelerating speed," which he said presents not only opportunity, but also new dangers.
"We know all too well after 9/11 just how technology and globalization has put power once reserved for states in the hands of the individual, raising the capacity of terrorists to do harm," Obama said. "Russia's aggression toward former Soviet states unnerves capitals in Europe, while China's economic rise and military reach worries its neighbors."
As developing nations embrace democracy and market economies, Obama said, 24-hour news cycles make it impossible to ignore sectarian conflicts, failing states and popular uprisings that might have received only passing notice a generation ago.
"It will be your generation's task to respond to this new world," he told the graduating cadets. "The question we face -- the question each of you will face - is not whether America will lead, but how we will lead, not just to secure our peace and prosperity, but also to extend peace and prosperity around the globe."
Obama noted that "regional aggression" in places such as Syria, southern Ukraine, the South China Sea or anywhere else in the world will "ultimately impact our allies, and could draw in our military."
Beyond this rationale, the President said, he believes the U.S. has an "abiding self-interest" in global security, but he cautioned that it's not to say every problem has a military solution. He quoted former president and five-star Army Gen. Dwight D. Eisenhower, who in 1947 said, "War is mankind's most tragic and stupid folly; to seek or advise its deliberate provocation is a black crime against all men."
"Like Eisenhower, this generation of men and women in uniform know all too well the wages of war," Obama said. "That includes those of you here at West Point. Four of the service members who stood in the audience when I announced the surge of our forces in Afghanistan gave their lives in that effort. A lot more were wounded. I believe America's security demanded those deployments."
The President said he is "haunted" by those who were killed or wounded, and would betray his duty to the graduates and the country if he ordered military intervention to fix a problem somewhere in the world or to avoid looking weak.
"Here's my bottom line," Obama said. "America must always lead on the world stage. If we don't, no one else will. The military that you have joined is, and always will be, the backbone of that leadership. But U.S. military action cannot be the only -- or even primary -- component of our leadership in every instance."
Just because we have the best hammer, Obama said, it doesn't mean that every problem is a nail, and due to high costs associated with military action, civilian leaders should be clear about how that power should be used.
The President explained four principles in his vision for how the United States and its military should lead in the years to come.
First, Obama said, the United States will use military force --unilaterally if necessary -- to defend its core interests if its people are threatened, when their livelihoods are at stake and when the security of its allies is in danger.
"In these circumstances, we still need to ask tough questions about whether our actions are proportional and effective and just," he said. "International opinion matters, but America should never ask permission to protect our people, our homeland, or our way of life."
Secondly, the President said, for the foreseeable future, the most direct threat to America, at home and abroad, remains terrorism.
"But a strategy that involves invading every country that harbors terrorist networks is naive and unsustainable," Obama said. "I believe we must shift our counterterrorism strategy -- drawing on the successes and shortcomings of our experience in Iraq and Afghanistan -- to more effectively partner with countries where terrorist networks seek a foothold."
The need for a new strategy, he said, reflects the fact that the threat from al-Qaida no longer comes from a centralized leadership, but rather from decentralized affiliates and extremists.
Obama said his fourth and final element of American leadership is "our willingness to act on behalf of human dignity."
"America's support for democracy and human rights goes beyond idealism," he said. "It is a matter of national security. Democracies are our closest friends and are far less likely to go to war. Economies based on free and open markets perform better and become markets for our goods. Respect for human rights is an antidote to instability and the grievances that fuel violence and terror."
While a new century has brought no end to tyranny, Obama said, American efforts in diplomacy and foreign assistance, as well as the sacrifices of its military, have led to more people living under elected governments today than at any time in human history.
"Ultimately, global leadership requires us to see the world as it is, with all its danger and uncertainty," he said. "We have to be prepared for the worst, prepared for every contingency."
But American leadership also requires seeing the world as it should be, Obama said -- a place where individual human aspirations matter, hope and not just fear governs, and where truth written in the nation's founding documents can steer the currents of history in a direction of justice.
"We cannot do that without you," he said. "Class of 2014, you have taken this time to prepare on the quiet banks of the Hudson. You leave this place to carry forward a legacy that no other military in human history can claim. Leaving here, you carry with you the respect of your fellow citizens. You will represent a nation with history and hope on our side.
"Your charge now," he added, "is not only to protect our country, but to do what is right and just. As your commander in chief, I know you will."
(Follow Army Sgt. 1st Class Tyrone Marshall on Twitter: @MarshallAFPS)