PENTAGON - Even if extremist groups in Africa were wiped out militarily, the continent's massive population of young people would continue to be susceptible to terror groups because of a lack of economic opportunity, the general in charge of U.S. military operations there said Thursday.

Speaking to the Senate Armed Services Committee, General Thomas Waldhauser, the head of U.S. Africa Command, said the economic crisis confronting African youth was "the biggest challenge" on the continent.

"We could knock off all the ISIL and Boko Haram this afternoon, [but] by the end of the week, so to speak, those ranks would be filled," Waldhauser said. ISIL is the U.S. military's acronym for the Islamic State group.

Young people in Africa joined extremist groups because "they needed a job, they needed a livelihood," he added. "It's not, for the most part in those regions, about ideology."

The general noted boys and girls under age 15 make up 41 percent of Africa's population. He told American lawmakers that Africa's young people need to have a future, one that comes from long-term investment in the region.

FILE - A Chadian soldier embraces a former child s FILE - A Chadian soldier embraces a former child soldier of insurgent group Boko Haram in Ngouboua, Chad, April 22, 2015. The young men said they were Chadian nationals forced to join Boko Haram while studying the Quran in Nigeria, and that they escaped and turned themselves in to Chadian authorities. FILE - A Chadian soldier embraces a former child soldier of insurgent group Boko Haram in Ngouboua, Chad, April 22, 2015. The young men said they were Chadian nationals forced to join Boko Haram while studying the Quran in Nigeria, and that they escaped and turned themselves in to Chadian authorities.

'Can't kill our way to victory'

"We've got to find a way to get at education, health care," he said. "We can't kill our way to victory here."

The United States has provided hundreds of millions of dollars in aid during the past year to the Lake Chad region, where Boko Haram is centered, in the form of food, basic household items, youth programs and other humanitarian assistance.

Officials say another $40 million has been devoted to border security enhancement for Cameroon, Niger, Chad and Nigeria.

Boko Haram has pledged allegiance to the Islamic State group, whose fighters were recently pushed out of Sirte, Libya, their African headquarters. Despite those setbacks in North Africa, Waldhauser said, the terror group has been making "inroads" in Somalia, on the east coast of the continent.

U.S. Secretary of State John Kerry and entrepreneu FILE - Then-U.S. Secretary of State John Kerry and entrepreneur Patricia Nzolantima point at an ultrasound machine during a tour of a Sustainable Investment in Sub-Saharan Africa medical supply store in Kinshasa, DRC, May 3, 2014. FILE - Then-U.S. Secretary of State John Kerry and entrepreneur Patricia Nzolantima point at an ultrasound machine during a tour of a Sustainable Investment in Sub-Saharan Africa medical supply store in Kinshasa, DRC, May 3, 2014.

'Soft power' more effective

The general told Senator Lindsey Graham, a South Carolina Republican, that "soft power" — the use of economic or cultural influence rather than military might — is an important approach to combating extremism on the continent.

"Once you have a secure environment, development needs to take place, and that's where soft power kicks in," Waldhauser said.

In reply, Graham urged all members of Congress to keep Waldhauser's comments in mind as they work on President Donald Trump's upcoming budget, which reputedly will include substantial cuts in foreign aid and humanitarian efforts.

"Any budget we pass that guts the State Department's budget, you will never win this war," the senator said, referring to wars against extremism in both Africa and the Middle East.