(CNN) -- President Obama told West Point graduates that the United States faces "difficult days ahead" in its fight against insurgents in Afghanistan and said that the threat posed by al Qaeda operatives across the globe "will not go away soon."





Speaking at the U.S. Military Academy commencement in New York, Obama praised the graduates for their achievements and laid out a scenario of military and societal challenges in what is the ninth West Point commencement during the wars in Iraq and Afghanistan and the fight against international terrorism.





"This time of war began in Afghanistan, a place that may seem as far from this peaceful bend in the Hudson River as anywhere on Earth," Obama said, referring to a conflict that started after the al Qaeda terror network attacked the United States on September 11, 2001.





"The war began only because our own cities and civilians were attacked by violent extremists who plotted from that distant place, and it continues only because that plotting persists to this day."





While the United States and its allies battled in Afghanistan, the U.S. military launched an invasion of Iraq in 2003, toppling the Saddam Hussein regime and battling insurgents for years until that war began to wind down in the last couple of years. But the Afghan conflict persists as the United States and its allies battle tenacious militants from the Taliban militant movement.





Obama said as the Iraq war ends, America is "pressing forward in Afghanistan" and faces a "tough fight" against a nimble insurgency.





"From Marja to Kandahar, that is what the Taliban has done through assassination, indiscriminate killing and intimidation," Obama said, referring to the main militant and two southern Afghan battlegrounds. "And any country that has known decades of war will be tested in finding political solutions to its problems, and providing governance that can sustain progress and serve the needs of its people. "





Obama said that even though the nature of the war has changed in the past nine years, it remains just as important as it was after the 9/11 attacks on the World Trade Center and Pentagon. He said the United States has helped bring hope and sovereign government to Afghanistan, but "there will be difficult days ahead."





"We toppled the Taliban regime; now we must break the momentum of a Taliban insurgency and train Afghan security forces," he said. "We will adapt, we will persist, and I have no doubt that together with our Afghan and international partners, we will succeed in Afghanistan."





As for al Qaeda's activities, Obama defended the "campaign to disrupt, dismantle and to defeat al Qaeda," saying it's an "international effort that is necessary and just."





While he said there has been "more success in eliminating al Qaeda leaders in recent months than in recent years," the group will continue its recruitment efforts.





"We see that in bombs that go off in Kabul and Karachi. We see it in attempts to blow up an airliner over Detroit or an SUV in Times Square, even as these failed attacks show that pressure on networks like al Qaeda is forcing them to rely on terrorists with less time and space to train," he said. "We see it in al Qaeda's gross distortion of Islam, their disrespect for human life, and their attempts to prey upon fear and hatred and prejudice."





Obama dismissed al Qaeda and its affiliates as "small men on the wrong side of history," but acknowledged that the threat they pose "will not go away soon."





"This is a different kind of war," he said. "There will be no simple moment of surrender to mark the journey's end. No armistice or banner headline."





The president said America's "strength and resilience" will counter people attempting to sow fear.





"Terrorists want to scare us," he said, but "New Yorkers go about their lives unafraid. Extremists want a war between America and Islam, but Muslims are a part of our national life, including those who serve in our Army. Adversaries want to divide us, but
What is Obama's challenge for Afghanistan? Where will the US succeed? Where did Obama speak? West point had a guest speaker of whom?
providing governance that can sustain progress and serve the needs of its people. Afghanistan." West Point President
question: What is Obama's challenge for Afghanistan?, answer: providing governance that can sustain progress and serve the needs of its people. | question: Where will the US succeed?, answer: Afghanistan." | question: Where did Obama speak?, answer: West Point | question: West point had a guest speaker of whom?, answer: President