President Obama delivered the following remarks at the United States Military Academy at West Point, N.Y., commencement ceremony on May 28, 2014. Transcript courtesy of Federal News Service.

PRESIDENT OBAMA: Thank you. Thank you so much. Thank you. Thank you, General Caslen, for that introduction. General Trainor, General Clarke, faculty and staff at West Point, you have been outstanding stewards of this proud institution and outstanding mentors for the newest officers in the United States Army.

I’d like to acknowledge the Army’s leadership -- General McHugh -- Secretary McHugh, General Odierno, as well as Senator Jack Reed who is here and a proud graduate of West Point himself. To the class of 2014, I congratulate you on taking your place on the Long Gray Line.

Among you is the first all-female command team: Erin Mauldin and Austen Boroff. In Calla Glavin, you have a Rhodes Scholar, and Josh Herbeck proves that West Point accuracy extends beyond the three point line. (Laughter.)

To the entire class, let me reassure you in these final hours at West Point, as commander in chief, I hereby absolve all cadets who are on restriction for minor conduct offenses. (Laughter, applause.)

Let me just say that nobody ever did that for me when I was in school.

I know you join me in extending a word of thanks to your families. Joe DeMoss, whose son James is graduating, spoke for a whole lot of parents when he wrote me a letter about the sacrifices you’ve made. “Deep inside,” he wrote, “we want to explode with pride at what they are committing to do in the service of our country.” Like several graduates, James is a combat veteran, and I would ask all of us here today to stand and pay tribute not only to the veterans among us, but to the more than 2.5 million Americans who have served in Iraq and Afghanistan, as well as their families. (Applause.)

It is a particularly useful time for America to reflect on those who’ve sacrificed so much for our freedom, a few days after Memorial Day. You are the first class to graduate since 9/11 who may not be sent into combat in Iraq or Afghanistan. (Cheers, applause.)

When I first spoke at West Point in 2009, we still had more than 100,000 troops in Iraq. We were preparing to surge in Afghanistan. Our counterterrorism efforts were focused on al-Qaida’s core leadership -- those who had carried out the 9/11 attacks. And our nation was just beginning a long climb out of the worst economic crisis since the Great Depression.

Four and a half years later, as you graduate, the landscape has changed. We have removed our troops from Iraq. We are winding down our war in Afghanistan. Al-Qaida’s leadership on the border region between Pakistan and Afghanistan has been decimated, and Osama bin Laden is no more. (Cheers, applause.) And through it all, we’ve refocused our investments in what has always been a key source of American strength: a growing economy that can provide opportunity for everybody who’s willing to work hard and take responsibility here at home.

In fact, by most measures America has rarely been stronger relative to the rest of the world. Those who argue otherwise -- who suggest that America is in decline or has seen its global leadership slip away -- are either misreading history or engaged in partisan politics.

Think about it. Our military has no peer. 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. Meanwhile, our economy remains the most dynamic on Earth, our businesses the most innovative. Each year, we grow more energy independent. From Europe to Asia, we are the hub of alliances unrivaled in the history of nations.

America continues to attract striving immigrants. The values of our founding inspire leaders in parliaments and new movements in public squares around the globe. And when a typhoon hits the Philippines, or schoolgirls are kidnapped in Nigeria, or masked men occupy a building in Ukraine, it is America that the world looks to for help. (Applause.) So the United States is and remains the one indispensable nation. That has been true for the century past, and it will be true for the century to come.

But the world is changing with accelerating speed. This presents 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 individuals, raising the capacity of terrorists to do harm.

Russia’s aggression towards former Soviet states unnerves capitals in Europe while China’s economic rise and military reach worries its neighbors.

From Brazil to India, rising middle classes compete with us, and governments seek a greater say in global forums. And even as developing nations embrace democracy and market economies, 24-hour news and social media makes it impossible to ignore the continuation of 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. 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 extend peace and prosperity around the globe.

Now, this question isn’t new. At least since George Washington served as commander in chief, there have been those who warned against foreign entanglements that do not touch directly on our security or economic well-being.

Today, according to self-described realists, conflicts in Syria or Ukraine or the Central African Republic are not ours to solve. And not surprisingly, after costly wars and continuing challenges here at home, that view is shared by many Americans.

A different view, from interventionists from the left and right, says that we ignore these conflicts at our own peril, that America’s willingness to apply force around the world is the ultimate safeguard against chaos, and America’s failure to act in the face of Syrian brutality or Russian provocations not only violates our conscience, but invites escalating aggression in the future.

And each side can point to history to support its claims, but I believe neither view fully speaks to the demands of this moment. It is absolutely true that in the 21st century, American isolationism is not an option. We don’t have a choice to ignore what happens beyond our borders. If nuclear materials are not secure, that poses a danger to American citizens.

As the Syrian civil war spills across borders, the capacity of battle-hardened extremist groups to come after us only increases. Regional aggression that goes unchecked, whether in southern Ukraine or the South China Sea or anywhere else in the world, will ultimately impact our allies, and could draw in our military. We can’t ignore what happens beyond our boundaries.

And beyond these narrow rationales, I believe we have a real stake -- abiding self-interest -- in making sure our children and our grandchildren grow up in a world where schoolgirls are not kidnapped; where individuals aren’t slaughtered because of tribe or faith or political belief.

I believe that a world of greater freedom and tolerance is not only a moral imperative; it also helps keep us safe.

But to say that we have an interest in pursuing peace and freedom beyond our borders is not to say that every problem has a military solution. Since World War II, some of our most costly mistakes came not from our restraint but from our willingness to rush into military adventures without thinking through the consequences, without building international support and legitimacy for our action, without leveling with the American people about the sacrifices required. Tough talk often draws headlines, but war rarely conforms to slogans. As General Eisenhower, someone with hard-earned knowledge on this subject, said at this ceremony in 1947, “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, and 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. But I am haunted by those deaths. I am haunted by those wounds. And I would betray my duty to you, and to the country we love, if I sent you into harm’s way simply because I saw a problem somewhere in the world that needed to be fixed, or because I was worried about critics who think military intervention is the only way for America to avoid looking weak.

Here’s my bottom line: 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 does not mean that every problem is a nail.

And because the costs associated with military action are so high, you should expect every civilian leader -- and especially your commander in chief -- to be clear about how that awesome power should be used. So let me spend the rest of my time describing my vision for how the United States of America, and our military, should lead in the years to come, for you will be part of that leadership.

First, let me repeat a principle I put forward at the outset of my presidency: The United States will use military force, unilaterally if necessary, when our core interests demand it -- when our people are threatened; when our livelihoods are at stake; when the security of our allies is in danger.

In these circumstances, we still need to ask tough questions about whether our actions are proportional and effective and just. International opinion matters, but America should never ask permission to protect our people, our homeland or our way of life. (Applause.)

On the other hand, when issues of global concern do not pose a direct threat to the United States, when such issues are at stake, when crises arise that stir our conscience or push the world in a more dangerous direction but do not directly threaten us, then the threshold for military action must be higher. In such circumstances, we should not go it alone. Instead, we must mobilize allies and partners to take collective action. We have to broaden our tools to include diplomacy and development, sanctions and isolation, appeals to international law, and, if just, necessary and effective, multilateral military action. In such circumstances, we have to work with others because collective action in these circumstances is more likely to succeed, more likely to be sustained, less likely to lead to costly mistakes.

This leads to my second point. 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. 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.

And the need for a new strategy reflects the fact that today’s principal threat no longer comes from a centralized al-Qaida leadership. Instead it comes from decentralized al-Qaida affiliates and extremists, many with agendas focused in the countries where they operate. And this lessens the possibility of large-scale 9/11-style attacks against the homeland, but it heightens the danger of U.S. personnel overseas being attacked, as we saw in Benghazi. It heightens the danger to less defensible targets, as we saw in a shopping mall in Nairobi. So we have to develop a strategy that matches this diffuse threat, one that expands our reach without sending forces that stretch our military too thin or stir up local resentments.

We need partners to fight terrorists alongside us. And empowering partners is a large part of what we have done and what we are currently doing in Afghanistan. Together with our allies, America struck huge blows against al-Qaida core and pushed back against an insurgency that threatened to overrun the country.

But sustaining this progress depends on the ability of Afghans to do the job. And that’s why we trained hundreds of thousands of Afghan soldiers and police. Earlier this spring, those forces -- those Afghan forces -- secured an election in which Afghans voted for the first democratic transfer of power in their history. And at the end of this year, a new Afghan president will be in office, and America’s combat mission will be over.

Now -- (applause) -- that was an enormous achievement made because of America’s armed forces. But as we move to a train and advise mission in Afghanistan, our reduced presence there allows us to more effectively address emerging threats in the Middle East and North Africa. So earlier this year I asked my national security team to develop a plan for a network of partnerships from South Asia to the Sahel.

Today, as part of this effort, I am calling on Congress to support a new counterterrorism partnerships fund of up to $5 billion, which will allow us to train, build capacity and facilitate partner countries on the front lines. And these resources will give us flexibility to fulfill different missions, including training security forces in Yemen who’ve gone on the offensive against al-Qaida, supporting a multinational force to keep the peace in Somalia, working with European allies to train a functioning security force and border patrol in Libya and facilitating French operations in Mali.

A critical focus of this effort will be the ongoing crisis in Syria. As frustrating as it is, there are no easy answers there, no military solution that can eliminate the terrible suffering anytime soon. As president, I made a decision that we should not put American troops into the middle of this increasingly sectarian civil war, and I believe that is the right decision. But that does not mean we shouldn’t help the Syrian people stand up against a dictator who bombs and starves his own people. And in helping those who fight for the right of all Syrians to choose their own future, we are also pushing back against the growing number of extremists who find safe haven in the chaos.

So with the additional resources I’m announcing today, we will step up our efforts to support Syria’s neighbors -- Jordan and Lebanon, Turkey and Iraq -- as they contend with refugees and confront terrorists working across Syria’s borders. I will work with Congress to ramp up support for those in the Syrian opposition who offer the best alternative to terrorists and brutal dictators. And we will continue to coordinate with our friends and allies in Europe and the Arab World to push for a political resolution of this crisis and to make sure that those countries and not just the United States are contributing their fair share of support to the Syrian people.

Let me make one final point about our efforts against terrorism. The partnerships I’ve described do not eliminate the need to take direct action when necessary to protect ourselves. When we have actionable intelligence, that’s what we do, through capture operations, like the one that brought a terrorist involved in the plot to bomb our embassies in 1998 to face justice, or drone strikes, like those we’ve carried out in Yemen and Somalia.

There are times when those actions are necessary and we cannot hesitate to protect our people. But as I said last year, in taking direct action, we must uphold standards that reflect our values. That means taking strikes only when we face a continuing, imminent threat, and only where there is no certainty -- there is near certainty of no civilian casualties, for our actions should meet a simple test: We must not create more enemies than we take off the battlefield.

I also believe we must be more transparent about both the basis of our counterterrorism actions and the manner in which they are carried out. We have to be able to explain them publicly, whether it is drone strikes or training partners. I will increasingly turn to our military to take the lead and provide information to the public about our efforts. Our intelligence community has done outstanding work and we have to continue to protect sources and methods, but when we cannot explain our efforts clearly and publicly, we face terrorist propaganda and international suspicion, we erode legitimacy with our partners and our people, and we reduce accountability in our own government.

And this issue of transparency is directly relevant to a third aspect of American leadership, and that is our effort to strengthen and enforce international order.

After World War II, America had the wisdom to shape institutions to keep the peace and support human progress -- from NATO and the United Nations, to the World Bank and IMF. These institutions are not perfect, but they have been a force multiplier. They reducing the need for unilateral American action and increase restraint among other nations.

Now, just as the world has changed, this architecture must change as well. At the height of the Cold War, President Kennedy spoke about the need for a peace based upon a gradual evolution in human institutions. And evolving these international institutions to meet the demands of today must be a critical part of American leadership.

Now, there are lot of folks, a lot of skeptics who often downplay the effectiveness of multilateral action. For them, working through international institutions, like the U.N. or respecting international law, is a sign of weakness. I think they’re wrong. Let me offer just two examples why.

In Ukraine, Russia’s recent actions recall the days when Soviet tanks rolled into Eastern Europe. But this isn’t the Cold War. Our ability to shape world opinion helped isolate Russia right away. Because of American leadership, the world immediately condemned Russian actions, Europe and the G-7 joined with us to impose sanctions, NATO reinforced our commitment to Eastern European allies, the IMF is helping to stabilize Ukraine’s economy, OSCE monitors brought the eyes of the world to unstable parts of Ukraine.

And this mobilization of world opinion and international institutions served as a counterweight to Russian propaganda and Russian troops on the border and armed militias in ski masks.

This weekend, Ukrainians voted by the millions. Yesterday, I spoke to their next president. We don’t know how the situation will play out, and there will remain grave challenges ahead, but standing with our allies on behalf of international order, working with international institutions, has given a chance for the Ukrainian people to choose their future -- without us firing a shot.

Similarly, despite frequent warnings from the United States and Israel and others, the Iranian nuclear program steadily advanced for years. But at the beginning of my presidency, we built a coalition that imposed sanctions on the Iranian economy, while extending the hand of diplomacy to the Iranian government. And now we have an opportunity to resolve our differences peacefully. The odds of success are still long, and we reserve all options to prevent Iran from obtaining a nuclear weapon. But for the first time in a decade, we have a very real chance of achieving a breakthrough agreement, one that is more effective and durable than what we could have achieved through the use of force. And throughout these negotiations, it has been our willingness to work through multilateral channels that kept the world on our side.

The point is, this is American leadership. This is American strength.

In each case, we built coalitions to respond to a specific challenge. Now we need to do more to strengthen the institutions that can anticipate and prevent problems from spreading.

For example, NATO is the strongest alliance the world has ever known but we’re now working with NATO allies to meet new missions both within Europe, where our eastern allies must be reassured, but also beyond Europe’s borders, where our NATO allies must pull their weight to counterterrorism and respond to failed states and train a network of partners.

Likewise, the U.N. provides a platform to keep the peace in states torn apart by conflict. Now, we need to make sure that those nations who provide peacekeepers have the training and equipment to actually keep the peace so that we can prevent the type of killing we’ve seen in Congo and Sudan. We are going to deepen our investment in countries that support these peacekeeping missions because having other nations maintain order in their own neighborhoods lessens the need for us to put our own troops in harm’s way. It’s a smart investment. It’s the right way to lead. (Applause.)

Keep in mind, not all international norms relate directly to armed conflict. We have a serious problem with cyberattacks, which is why we’re working to shape and enforce rules of the road to secure our networks and our citizens. In the Asia Pacific, we’re supporting Southeast Asian nations as they negotiate a code of conduct with China on maritime disputes in the South China Sea, and we’re working to resolve these disputes through international law.

That spirit of cooperation needs to energize the global effort to combat climate change, a creeping national security crisis that will help shape your time in uniform, as we are called on to respond to refugee flows and natural disasters, and conflicts over water and food, which is why, next year, I intend to make sure America is out front in putting together a global framework to preserve our planet.

You see, American influence is always stronger when we lead by example. We cannot exempt ourselves from the rules that apply to everyone else. We can’t call on others to make commitments to combat climate change if a whole lot of our political leaders deny that it is taking place. We can’t try to resolve problems in the South China Sea when we have refused to make sure that the Law of the Sea Convention is ratified by the United States Senate, despite the fact that our top military leaders say the treaty advances our national security. That’s not leadership. That’s retreat. That’s not strength; that’s weakness. It would be utterly foreign to leaders like Roosevelt and Truman, Eisenhower and Kennedy.

I believe in American exceptionalism with every fiber of my being. But what makes us exceptional is not our ability to flout international norms and the rule of law; it is our willingness to affirm them through our actions.

(Applause.)

And that’s why I will continue to push to close Gitmo, because American values and legal traditions do not permit the indefinite detention of people beyond our borders. (Applause.) That’s why we’re putting in place new restrictions on how America collects and uses intelligence -- because we will have fewer partners and be less effective if a perception takes hold that we’re conducting surveillance against ordinary citizens. (Applause.) America does not simply stand for stability or the absence of conflict, no matter what the cost; we stand for the more lasting peace that can only come through opportunity and freedom for people everywhere -- which brings me to the fourth and final element of American leadership: our willingness to act on behalf of human dignity.

America’s support for democracy and human rights goes beyond idealism; 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.

A new century has brought no end to tyranny. In capitals around the globe -- including, unfortunately, some of America’s partners -- there has been a crackdown on civil society. The cancer of corruption has enriched too many governments and their cronies and enraged citizens from remote villages to iconic squares.

And watching these trends, or the violent upheavals in parts of the Arab world, it’s easy to be cynical. But remember that because of America’s efforts -- because of American diplomacy and foreign assistance, as well as the sacrifices of our military -- more people live under elected governments today than at any time in human history. Technology is empowering civil society in ways that no iron fist can control. New breakthroughs are lifting hundreds of millions of people out of poverty. And even the upheaval of the Arab world reflects the rejection of an authoritarian order that was anything but stable, and now offers the long-term prospect of more responsive and effective governance.

In countries like Egypt, we acknowledge that our relationship is anchored in security interests, from peace treaties to Israel to shared efforts against violent extremism. So we have not cut off cooperation with the new government, but we can and will persistently press for reforms that the Egyptian people have demanded.

And meanwhile, look at a country like Burma, which only a few years ago was an intractable dictatorship and hostile to the United States. Forty million people. Thanks to the enormous courage of the people in that country, and because we took the diplomatic initiative, American leadership, we have seen political reforms opening a once- closed society; a movement by Burmese leadership away from partnership with North Korea in favor of engagement with America and our allies.

We’re now supporting reform and badly needed national reconciliation through assistance and investment, through coaxing and, at times, public criticism. And progress there could be reversed, but if Burma succeeds we will have gained a new partner without having fired a shot -- American leadership.

In each of these cases, we should not expect change to happen overnight. That’s why we form alliances -- not only with governments, but also with ordinary people. For unlike other nations, America is not afraid of individual empowerment. We are strengthened by it. We’re strengthened by civil society. We’re strengthened by a free press. We’re strengthened by striving entrepreneurs and small businesses. We’re strengthened by educational exchange and opportunity for all people and women and girls. That’s who we are. That’s what we represent. (Applause.)

I saw that through a trip to Africa last year, where American assistance has made possible the prospect of an AIDS-free generation, while helping Africans care themselves for their sick. We’re helping farmers get their products to market to feed populations once endangered by famine. We aim to double access to electricity in sub- Saharan Africa so people are connected to the promise of the global economy. And all this creates new partners and shrinks the space for terrorism and conflict.

Now, tragically, no American security operation can eradicate the threat posed by an extremist group like Boko Haram -- the group that kidnapped those girls.

And that’s we have to focus not just on rescuing those girls right away, but also on supporting Nigerian efforts to educate its youth. This should be one of the hard-earned lessons of Iraq and Afghanistan, where our military became the strongest advocate for diplomacy and development. They understood that foreign assistance is not an afterthought -- something nice to do apart from our national defense, apart from our national security. It is part of what makes us strong.

Now, ultimately, global leadership requires us to see the world as it is, with all its danger and uncertainty. We have to be prepared for the worst, prepared for every contingency, but American leadership also requires us to see the world as it should be -- a place where the aspirations of individual human beings really matters, where hopes and not just fears govern; where the truths written into our founding documents can steer the currents of history in the direction of justice. And we cannot do that without you.

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. You do so as part of a team that extends beyond your units or even our Armed Forces, for in the course of your service, you will work as a team with diplomats and development experts.

You’ll get to know allies and train partners. And you will embody what it means for America to lead the world.

Next week I will go to Normandy to honor the men who stormed the beaches there. And while it’s hard for many Americans to comprehend the courage and sense of duty that guided those who boarded small ships, it’s familiar to you. At West Point, you define what it means to be a patriot.

Three years ago Gavin White graduated from this academy. He then served in Afghanistan. Like the soldiers who came before him, Gavin was in a foreign land, helping people he’d never met, putting himself in harm’s way for the sake of his community and his family and the folks back home. Gavin lost one of his legs in an attack. I met him last year at Walter Reed. He was wounded but just as determined as the day that he arrived here at West Point. And he developed a simple goal. Today his sister Morgan will graduate. And true to his promise, Gavin will be there to stand and exchange salutes with her. (Cheers, applause.)

We have been through a long season of war. We have faced trials that were not foreseen and we’ve seen divisions about how to move forward. But there is something in Gavin’s character, there is something in the American character, that will always triumph.

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 is not only to protect our country, but to do what is right and just. As your commander in chief, I know you will. May God bless you. May God bless our men and women in uniform. And may God bless the United States of America. (Cheers, applause.)