Updated at 5:26 p.m. ET

President Obama has warned that the campaign against the so-called Islamic State "will not be quick" as he cited gains made in Iraq and Syria by the coalition fighting the militant group.

"This will not be quick," Obama said at the Pentagon. "This is a long-term campaign."

He said the coalition against the Islamic State, also known as ISIS or ISIL, has hit the group with more than 5,000 airstrikes, destroying thousands of fighting positions, tanks, vehicles, bomb factories and training camps and killing thousands of fighters, including senior commanders. The Islamic State, Obama said, has lost more than a quarter of the populated areas it had seized in Iraq, and parts of Syria that it controlled, too.

"ISIL's recent losses in both Syria and Iraq prove that ISIL can and will be defeated," Obama said.

Obama said the U.S. continues to ramp up the training and support of local forces fighting the Islamic State on the ground in Iraq, and will "do more to train and equip the moderate opposition in Syria."

The Islamic State is one of several factions involved in the civil war in Syria. Obama said the only way for that civil war to end was if President Bashar Assad stepped down; a move, he said, that would unite the remaining factions against the Islamic State.

Obama said the coalition would also continue to target the oil and gas, and financial infrastructure that funds the Islamic State's operations, and to speed up the delivery of military equipment to Iraqi forces battling the organization. But, he added: "No amount of military force will end the terror that is ISIL unless it's matched by a broader effort — political and economic."

Obama said the U.S. was doing a better job of preventing large-scale attacks on the homeland, but that so-called lone-wolf terrorists are harder to detect.

"Here in the United States, we have seen all kinds of home-grown terrorism and tragically recent history reminds us how even a single individual motivated by a hateful ideology with access to dangerous weapons can inflict horrendous harm on Americans," he said. "Our efforts to counter violent extremism must not target any one community because of their faith or background, including patriotic Muslim Americans who are partners in keeping our country safe.

"That said, we also have to acknowledge that ISIL has been particularly effective at reaching out to and recruiting vulnerable people around the world, including here in the United States. And they are targeting Muslim communities around the world."

Obama said that in order to defeat groups such as the Islamic State, the U.S. must also "discredit their ideology, the twisted thinking that draws vulnerable people into their ranks."

Copyright 2016 NPR. To see more, visit http://www.npr.org/.