WASHINGTON (AFP) ― The core of President Barack Obama’s foreign policy was revealed in the moment he gazed into the eyes of hundreds of cadets at a West Point graduation ceremony on Wednesday.

“You are the first class to graduate since 9/11 who may not be sent into combat in Iraq or Afghanistan,” Obama said at the famed military academy in the state of New York.

Obama made his name as a young Illinois lawmaker railing against the invasion of Iraq, and rode that anti-war tide all the way to the White House.

His major foreign policy speech Wednesday, in which he laid out a blueprint for U.S. leadership in the world while avoiding military quagmires, was partly about political vindication.

“The main message that he delivered since being in office is ‘I am getting this country out of the two wars I have inherited,’” said James Goldgeier, dean of the School of International Service at American University.

“He said he is going to do it, and that is what he has done.”

Obama’s address, his latest attempt at defining his elusive foreign policy doctrine as he barrels from global crisis to global crisis, was many things.

It was an explanatory note for historians who begin sizing up his legacy in just two and a half years ― and who will ask for instance, why did Obama intervene in Libya but not in Syria?

It was a settling of political scores: Obama has bristled in recent months at criticism from the likes of John McCain and other Republicans who brand him feckless and say he is bullied by Russian President Vladimir Putin.

Obama tried to debunk the critique that being a reluctant warrior is a strength, not a weakness.

He enlisted General Dwight Eisenhower, whose 1953-1961 presidency is remembered as a peaceful interregnum between World War II and Korea and Vietnam.

“Tough talk often draws headlines, but war rarely conforms to slogans,” Obama said, before quoting Ike’s dictum: “War is mankind’s most tragic and stupid folly.”

The president also laid down a blueprint for future presidents on how America could lead the world but avoid spilling the blood which soaked the last decade of war.

Mark Jacobson, a former senior NATO official in Afghanistan, said Obama was sending a message that “an aggressive foreign policy or an internationalist United States does not mean military intervention.”

Obama’s speech came a day after he announced plans to leave a 9,800 strong training force behind in Afghanistan ― but added that all American soldiers would be home before he leaves office in early 2017.

Leadership in Obama’s lexicon means not rushing off into major land wars abroad or deploying military force to solve every problem: “Just because we have the best hammer does not mean that every problem is a nail,” he said.

It is reflected in his $5 billion plan to help equip allies to fight spreading Islamic extremism in an arc from South Asia to the Sahel.

The president staked out realist ground in a political space between interventionists who want to wield a big U.S. stick and isolationists who would let the world solve its own problems.

Above all, Obama counsels unsheathing the U.S. military only in a case of true last resort.

“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.”