WASHINGTON — During the height of the wars in Iraq and Afghanistan, the United States military often carried out dozens of daily operations against Al Qaeda and other extremist targets with heavily armed commandos and helicopter gunships.

But even before President Obama’s speech on Wednesday sought to underscore a shift in counterterrorism strategy — away from the Qaeda strongholds in and near those countries — American forces had changed their tactics in combating Al Qaeda and its affiliates, relying more on allied or indigenous troops with a limited American combat role.

Navy SEAL or Army Delta Force commandos will still carry out raids against the most prized targets, such as the seizure last fall of a Libyan militant wanted in the 1998 bombings of two United States Embassies in East Africa. But more often than not, the Pentagon is providing intelligence and logistics assistance to proxies, including African troops and French commandos fighting Islamist extremists in Somalia and Mali. And it is increasingly training foreign troops — from Niger to Yemen to Afghanistan — to battle insurgents on their own territory so that American armies will not have to.

A decade of military and intelligence operations have battered Al Qaeda’s headquarters in Pakistan and reduced the likelihood of a large-scale attack against the United States, counterterrorism officials say. But a more decentralized terrorist threat has heightened the danger to Americans abroad, putting at greater risk diplomatic outposts such as the mission in Benghazi, Libya, or commercial sites like the shopping mall in Nairobi, Kenya, that the Islamist extremist group the Shabab attacked last year, killing at least 67 people.