President Obama, in a rare visit to the Pentagon where he got an update on the military campaign against the Islamic State, acknowledged Monday that ISIS and its ideology have spread far beyond Iraq and Syria as he urged the world to unite against this threat – saying that if the U.S. tries to address it unilaterally, "We'll be playing whack-a-mole."

The president, giving a report card of sorts on the nearly yearlong military campaign against the terror network, offered a mixed picture. He cited a string of ISIS losses in Iraq and Syria in claiming they "can be pushed back" in the region.

"In short, ISIL's recent losses in both Syria and Iraq prove that ISIL can and will be defeated," Obama said, vowing: "We will ultimately prevail."

At the same time, he braced the public for a "long-term campaign" that will involve a "generational struggle" -- a global battle with extremists for hearts and minds.

In unusually blunt remarks, the president acknowledged that ISIS and its ideology "pose a grave threat beyond the region" that has spread around the world.

More On This...

The president cited deadly attacks in recent weeks in Tunisia, Kuwait and Egypt's Sinai Peninsula.

"We see a growing ISIL presence in Libya and attempts to establish footholds across North Africa, the Middle East, the Caucasus and Southeast Asia," Obama added, while also citing recent attacks in France, Canada and beyond. He said the world must unite against this threat, and that if the U.S. tries to address it unilaterally, "We'll be playing whack-a-mole."

Following his remarks, a spokesman for Speaker of the House John Boehner, R-Ohio, said, "A speech isn't a strategy. At no point in his remarks did President Obama indicate he's doing anything to change course and actually build the broad, overarching plan that's needed to take on these savage terrorists and win."

Obama spoke to the media at the Pentagon, following meetings with top military officials and other national security advisers for an update on the strategy.

The meetings follow a wave of weekend airstrikes by the U.S.-led coalition in eastern Syria. The coalition says it was one of the most sustained aerial operations carried out in Syria to date.

The meetings also come a month after Obama approved sending up to 450 additional U.S. troops to Iraq, as part of an effort to help and train local forces. Addressing a key goal of that effort, Obama said Monday that "more Sunni volunteers are coming forward."

Aside from long-running struggles in attracting Sunni volunteers in Iraq, efforts to train Syrian rebels are also sputtering. Fewer than 100 rebels are being trained by the U.S., far fewer than the goal of producing 5,400 fighters a year.

But Obama cited a string of victories over ISIS in both countries, including in Kirkuk, Tikrit and Kobani. He said, with the help of more than 5,000 coalition airstrikes, ISIS has lost more than a quarter of the population areas it once had seized in Iraq.

"ISIL's strategic weaknesses are real," Obama said.

But he said ISIS is "nimble" and digs in among local civilian populations, and, "It will take time to root them out."

And, after a July Fourth holiday where security officials were on alert over terror threats, Obama warned that preventing lone wolf terror attacks on the homeland will continue to be a challenge.

"We're going to have to pick up our game," he said.

Obama met Monday with more than 30 Pentagon officials and national security advisers, including Secretary of Defense Ash Carter and Gen. Martin Dempsey, the chairman of the Joint Chiefs of Staff.

The Associated Press contributed to this report.