Media playback is unsupported on your device Media caption Watch President Obama's address in full

President Barack Obama has delivered a key foreign policy address. Here's the speech in full - with analysis of key passages by BBC North America Editor Mark Mardell.

Good morning. Thank you, General Caslen, for that introduction. To General Trainor, General Clarke, and the faculty and staff at West Point - you have been outstanding stewards of this proud institution, and excellent mentors for the newest officers in the United States Army. I'd like to acknowledge the Army's leadership - Secretary McHugh and General Odierno, as well as Senator Jack Reed - 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. 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 offences. 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 many parents when he wrote me a letter about the sacrifices you have 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 like to 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, and their families. It is a particularly useful time for America to reflect on those who have sacrificed so much for our freedom - for you are the first class to graduate since 9/11 who may not be sent into combat in Iraq or Afghanistan.

Mark Mardell:That got a big cheer - and the president knows the country too is happy that he has ended America's long wars. But he has to balance this - many also think their country not only has a right, it has a duty, to shape events around the globe.

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-Qaeda's core leadership. 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, the landscape has changed. We have removed our troops from Iraq. We are winding down our war in Afghanistan. Al-Qaeda's leadership in the border region between Pakistan and Afghanistan has been decimated, and Osama Bin Laden is no more. Through it all, we have refocused our investments in a key source of American strength: a growing economy that can provide opportunity 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 unrivalled 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 girls are kidnapped in Nigeria, or masked men occupy a building in Ukraine - it is America that the world looks to for help. The United States is the one indispensable nation. That has been true for the century passed, and will likely be true for the century to come.

Media playback is unsupported on your device Media caption Mark Mardell's analysis: "This was obviously a fairly difficult speech"

Mark Mardell: This is a hard speech for Mr Obama to make - he has to do it because there have been so many attacks on his foreign policy, against a background of feeling that the US isn't the power it once was. So he's saying the country is as great as ever, and lists achievements since he's been in office.

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 globalisation has put power once reserved for states in the hands of the individual, raising the capacity of terrorists to do harm. Russia's aggression toward former Soviet states unnerves capitals in Europe, while China's economic rise and military reach worries its neighbours. From Brazil to India, rising middle classes compete with our own, and governments seek a greater say in global forums. And even as developing nations embrace democracy and market economies, 24-hour news and pervasive social media makes 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. The question we face - the question 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.

Mark Mardell: So no doubt here - Mr Obama is not abandoning America's leading role in the world. He is endorsing the view that his country has a special, almost mystical, mission.

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. Not surprisingly, after costly wars and continuing challenges at home, that view is shared by many Americans. A different view, from interventionists on the left and right, says 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.

Media playback is unsupported on your device Media caption Mark Mardell's analysis: "This is very typically Obama the intellectual, the professor"

Mark Mardell:This is very Barack Obama as the professorial president, thoughtfully laying out two paths, pointing out that they each have intellectual merit. He is, of course, about to discover a synthesis.

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. If nuclear materials are not secure, that could pose a danger in American cities. As the Syrian civil war spills across borders, the capacity of battle-hardened groups to come after us increases. Regional aggression that goes unchecked - in southern Ukraine, the South China Sea, or anywhere else in the world - will ultimately impact our allies, and could draw in our military. Beyond these narrow rationales, I believe we have a real stake - an abiding self-interest - in making sure our children grow up in a world where school-girls are not kidnapped; where individuals aren't slaughtered because of tribe or faith or political beliefs. I believe that a world of greater freedom and tolerance is not only a moral imperative - it also helps keep us safe.

Media playback is unsupported on your device Media caption Mark Mardell's analysis: "Of course it is not really a synthesis"

Mark Mardell: Actually it isn't really a synthesis - he comes down pretty heavily against any notion of isolationism. He doesn't even give room to the view of many on the left that it is wrong, a new form of imperialism, for the US to impose its will on the world.

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 Two, 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, or levelling with the American people about the sacrifice required. Tough talk 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. That includes those of you 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. 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 fixing, 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 US 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.

Mark Mardell: Mr Obama's paradox is that he is commander-in-chief of the most powerful military ever known, in a country that doesn't want to go to war. So he uses a simple saying to reinforce his point - just because you can fight, and would probably win, it doesn't mean you have to do so.

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.

Let me spend the rest of my time, then, describing my vision for how the United States of America, and our military, should lead in the years to come.

Media playback is unsupported on your device Media caption President Obama: ''America should never ask permission to protect our people''

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 livelihood is at stake; or when the security of our allies is in danger. In these circumstances, we still need to ask tough questions about whether our action is proportional, effective and just. International opinion matters. But America should never ask permission to protect our people, our homeland, or our way of life. On the other hand, when issues of global concern that do not pose a direct threat to the United States are at stake - when crises arise that stir our conscience or push the world in a more dangerous direction - then the threshold for military action must be higher. In such circumstances, we should not go it alone. Instead, we must mobilise allies and partners to take collective action. We must broaden our tools to include diplomacy and development; sanctions and isolation; appeals to international law and - if just, necessary, and effective - multilateral military action. We must do so because collective action in these circumstances is more likely to succeed, more likely to be sustained, and less likely to lead to costly mistakes.

Mark Mardell: So this is the Obama doctrine - we will fight for core interests, and for allies. But not just to prevent bad stuff from happening. At least not that alone. This has a potential danger - it is a signal to potential foes that while they have got to leave Lithuania and Latvia alone, the US won't fight for Ukraine or Georgia. Likewise Japan can rest easy. But not Vietnam. It makes sense but drawing red lines too clearly means people know where they can take action with impunity.

Media playback is unsupported on your device Media caption President Barack Obama: "We must shift our counter-terrorism strategy"

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 harbours 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. This reflects the fact that today's principal threat no longer comes from a centralised al-Qaeda leadership. Instead, it comes from decentralised al-Qaeda affiliates and extremists, many with agendas focused in the countries where they operate. This lessens the possibility of large-scale 9/11-style attacks against the homeland, but heightens the danger to US personnel overseas, as we saw in Benghazi or less defensible targets, as we saw in a shopping mall in Nairobi. We need a strategy that matches this diffuse threat; one that expands our reach without sending forces that stretch our military thin, or stir up local resentments.

Empowering partners is a large part of what we've done in Afghanistan. Together with our allies, America struck huge blows against al-Qaeda 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. That's why we trained hundreds of thousands of Afghan soldiers and police. Earlier this spring, those forces secured an election in which Afghans voted for the first democratic transfer of power in their history. At the end of this year, a new Afghan president will be in office, and America's combat mission will be over.

Now, as we move to a train-and-advise mission in Afghanistan, our reduced presence there will allow us to more effectively address emerging threats in the Middle East and North Africa. 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 Counter-Terrorism Partnerships Fund of up to $5bn, which will allow us to train, build capacity, and facilitate partner countries on the front lines. These resources will give us flexibility to fulfil different missions, including training security forces in Yemen who have gone on the offensive against al-Qaeda; 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 - no military solution that can eliminate the terrible suffering any time 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 people. And in helping those who fight for the right of all Syrians to choose their own future, we also push back against the growing number of extremists who find safe haven in the chaos.

Media playback is unsupported on your device Media caption Mark Mardell's analysis: "Why now, why so late?"

Mark Mardell: For those who've had enough philosophy, some hard news - help to the Syrian rebels and a $5bn anti-terrorist fund. The trouble with this is that there is no reason he is announcing this today, rather than two years ago. And if he'd announced it five years ago the situation in the world might, just might, be different. If it wouldn't, then it's pretty pointless now as well.

With the additional resources I'm announcing today, we will step up our efforts to support Syria's neighbours - Jordan and Lebanon; Turkey and Iraq - as they host refugees, and confront terrorists working across Syrian borders. I will work with Congress to ramp up support for those in the Syrian opposition who offer the best alternative to terrorists and a brutal dictator. 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 make sure that those countries, and not just the United States, are contributing their fair share of support to the Syrian people.

Media playback is unsupported on your device Media caption President Obama: 'We will step up efforts to support Syria's neighbours"

Let me make one final point about our efforts against terrorism. The partnership I've described does 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 have carried out in Yemen and Somalia. 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 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 be more transparent about both the basis for our actions, and the manner in which they are carried out - 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 must 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.

This issue of transparency is directly relevant to a third aspect of American leadership: our efforts to strengthen and enforce international order.

After World War Two, 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. Though imperfect, these institutions have been a force multiplier - reducing the need for unilateral American action, and increased restraint among other nations. But 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". Evolving these institutions to meet the demands of today must be a critical part of American leadership.

Of course, sceptics often downplay the effectiveness of multilateral action. For them, working through international institutions, 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 stabilise Ukraine's economy. OSCE monitors brought the eyes of the world to unstable parts of Ukraine. This mobilisation of world opinion and institutions served as a counterweight to Russian propaganda, Russian troops on the border, and armed militias. 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 be grave challenges. But standing with our allies on behalf of international order has given a chance for the Ukrainian people to choose their future.

Mark Mardell:This is not exactly signalling a huge commitment - the US is something more than a curious bystander but this is not exactly something that is going to keep President Putin awake at nights. If Russia is indeed isolated he does not seem at all bothered.

Similarly, despite frequent warnings from the United States, 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. 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 would be 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.

Mark Mardell: This is the big one - pull off a deal with Iran and many of Mr Obama's critics will fall silent. Not all of course, but those who aren't just doing it to score points.

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 them from spreading. For example, Nato is the strongest alliance the world has ever known. But we are now working with Nato allies to meet new missions - within Europe, where our Eastern allies must be reassured; and also beyond Europe's borders, where our Nato allies must pull their weight to counter-terrorism, respond to failed states, and train a network of partners.

Likewise, the UN provides a platform to keep the peace in states torn apart by conflict. Now we need to make sure that those nations who provide peace-keepers have the training and equipment to keep the peace, so that we can prevent the type of killing we have seen in Congo and Sudan. We are deepening our investment in countries that support these missions. Because having other nations maintain order in their own neighbourhoods lessens the need for us to put our own troops in harm's way. It is a smart investment. It's the right way to lead.

Keep in mind, not all international norms relate directly to armed conflict. In the face of cyber-attacks, we are working to shape and enforce rules of the road to secure our networks and citizens. In the Asia Pacific, we are supporting Southeast Asian nations as they negotiate a code of conduct with China on the South China Sea, and are working to resolve territorial and maritime disputes through international law. That spirit of cooperation must energise the global effort to combat climate change - a creeping national security crisis that will help shape your time in uniform, as we're called on to respond to refugee flows, natural disasters, and conflicts over water and food. That's why, next year, I intend to make sure America is out front in 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 so many of our political leaders deny that it is taking place. It's a lot harder to call on China to resolve its maritime disputes under the Law of the Sea Convention when the United States Senate has refused to ratify it - despite the repeated insistence of our top military leaders that the treaty advances our national security. That's not leadership; that's retreat. That's not strength; that's weakness. And it would be utterly foreign to leaders like Roosevelt and Truman; Eisenhower and Kennedy.

Mark Mardell: This is pretty partisan stuff for a speech like this - but he feels it deeply and is portraying Republicans in Congress as the ones who are really weak and who don't stick to American values.

I believe in American exceptionalism with every fibre of my being. But what makes us exceptional is not our ability to flout international norms and the rule of law; it's our willingness to affirm them through our actions. That's why I will continue to push to close GTMO [Guantanamo Bay detention camp] - because American values and legal traditions don't permit the indefinite detention of people beyond our borders. That's why we are 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 are conducting surveillance against ordinary citizens. America does not simply stand for stability, or the absence of conflict, no matter what the price; 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's a matter of national security. Democracies are our closest friends, and are far less likely to go to war. Free and open economies 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 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. Watching these trends, or the violent upheaval in parts of the Arab World, it is easy to be cynical.

But remember that because of America's efforts - through diplomacy and foreign assistance, as well as the sacrifices of our military - more people live under elected governments today than 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 out of poverty. And even the upheaval of the Arab World reflects the rejection of an authoritarian order that was anything but stable, and offers the long-term prospect of more responsive and effective governance.

In Egypt, we acknowledge that our relationship is anchored in security interests - from the peace treaty with 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 the reforms that the Egyptian people have demanded.

Meanwhile, look at a country like Burma, which only a few years ago was an intractable dictatorship, hostile to the United States. Thanks to the enormous courage of the people in that country - and because we took the diplomatic initiative - we have seen political reforms opening a once closed society; a movement away from partnership with North Korea in favour of engagement with America and our allies. We are now supporting reform - and badly needed national reconciliation - through assistance and investment; coaxing and, at times, public criticism. Progress could be reversed. But if Burma succeeds, we will have gained a new partner without having fired a shot.

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

I saw that throughout my trip to Africa last year. American assistance has made possible the prospect of an Aids-free generation, while helping Africans care for their sick. We are helping farmers get their products to market, and feeding 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.

All this creates new partners and shrinks the space for terrorism. Tragically, no American security operation can eradicate the threat posed by an extremist group like Boko Haram. That is why we must focus both on rescuing those girls, but also on supporting Nigerian efforts to educate its youth. Indeed, this should be one of the hard-earned lessons of Iraq and Afghanistan, where our military became the strongest advocate for diplomacy and development. Foreign assistance isn't an afterthought - something nice to do apart from our national defence. It's part of what makes us strong.

Ultimately, global leadership requires us to see the world as it is, with all its danger and uncertainty. But American leadership also requires us to see the world as it should be - a place where the aspirations of individual human beings matter; 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.

Media playback is unsupported on your device Media caption Mark Mardell's analysis: "The critics will demand real action"

Mark Mardell: The problem with this speech is that it is a restatement of Mr Obama's policy, not a re-evaluation. He's defending a policy that has manifestly failed to produce a stable world free from crisis and turmoil. That doesn't mean anyone else would have had better luck with a different sort of policy - but it does mean he is defending something that has not had many success. He's avoided a world where America is up to its arms in new wars - but he has hardly brought forth a shining new dawn for peace and democracy. To some questions, there are no answers, but saying so is hardly glorious.

Graduates, 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. And you do so as part of a team that extends beyond your units or even our Armed Forces. In the course of your service, you will work as a team with diplomats and development experts. You will get to know allies and train partners. You will embody what it means for America to lead.

Next week, I will go to Normandy to honour the men who stormed the beaches. And while it is hard for many Americans to comprehend the courage and sense of duty that guided those who boarded small ships, it is 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, he was in a foreign land, helping people he'd never met, putting himself in harm's way for the sake of his people 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. 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.

We have been through a long season of war. We have faced trials that were not foreseen, and divisions about how to move forward. But there is something in Gavin's character, and America's 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.