WEST POINT, N.Y. — President Obama tried once more to articulate his vision of the American role in the world on Wednesday, telling graduating cadets here that the nation they were being called to serve would seek to avoid military misadventures abroad, even as it confronts a new set of terrorist threats from the Middle East to Africa.

Speaking at the commencement of the United States Military Academy, Mr. Obama disputed critics who say his cautious response to crises like Syria’s civil war and Russian aggression toward Ukraine had eroded America’s leadership in the world. Those critics, he said, were “either misreading history or engaged in partisan politics.”

But for a president who has promised to take the United States off a permanent war footing, Mr. Obama painted an unsettling portrait of the world, 13 years after the attacks of Sept. 11, 2001. The nation, he said, had, in effect, traded Al Qaeda in Afghanistan for a more diffuse threat from extremists in Syria, Nigeria, Somalia, Yemen, Mali and other countries.

A day after announcing that the last American soldier would leave Afghanistan at the end of 2016, Mr. Obama told a new class of Army officers that some of them would be sent on murkier missions, helping endangered nations deal with their own terrorist groups.