WASHINGTON (AP) — President Joe Biden signed an order Monday to redeploy hundreds of U.S. troops to Somalia to counter the Islamic extremist rebel group al-Shabab, an effort that American military leaders said had been hampered by President Donald Trump’s late-term decision to withdraw forces from the country.

U.S. troops will be repositioned from elsewhere in Africa to train and provide other support to Somali forces in their fight against al-Shabab, which is considered the largest and wealthiest affiliate of the al-Qaida extremist organization.

“Our forces are not now, nor will they be, directly engaged in combat operations,” said Pentagon press secretary John Kirby. “The purpose here is to enable a more effective fight against al-Shabab by local forces.”

It’s a reminder that the U.S. remains engaged in the long fight against Islamic extremists around the world, even if the effort has been eclipsed by the war in Ukraine and other matters.

The decision to station forces again in Somalia, rather than rotate them in and out, is intended “to maximize the safety and effectiveness of our forces and enable them to provide more efficient support to our partners,” National Security Council spokesperson Adrienne Watson said in announcing the redeployment.

U.S. troops in Somalia will total “under 500” according to a senior Biden administration official who spoke on condition of anonymity to brief journalists on the decision.

In addition to training Somali forces, American troops will also provide security to personnel from the State Department and the U.S. Agency for International Development as they work with the government to emerge from years of turmoil, the official said.

Trump abruptly ordered the withdrawal of approximately 700 troops from Somalia at the end of his term in January 2021, an extension of a broader policy of seeking to pull the U.S. out of what he derisively referred to as “endless wars” around the world.

But military leaders said that came at a cost, wasting time, money and momentum as troops had to rotate in and out of the country.

Gen. Stephen Townsend, head of U.S. Africa Command, told Congress in March that the rotations, which he called “commuting to work,” were not efficient or effective and put American troops at greater risk.

“In my view, we are marching in place at best. We may be backsliding,” Townsend told the Senate Armed Forces Committee.

Defense Secretary Lloyd Austin requested the deployment “to reestablish a persistent U.S. military presence in Somalia to enable a more effective fight against al-Shabaab, which has increased in strength and poses a heightened threat,” said an administration official said, speaking on condition of anonymity to discuss the plan before the White House announcement.

Biden’s decision to sign the order was first reported by The New York Times, which also said the the president had a approved a Pentagon request for standing authority to target about a dozen suspected leaders of al-Shabab.

The group has killed more than a dozen Americans in East Africa, including three in a January 2020 attack on a base used by U.S. counterterrorism forcesin Kenya. Later that year, the U.S. charged a Kenyanwho had been taking flight lessons in the Philippines with planning a 9/11-style hijacking attack on behalf of al-Shabab.

The rebel group has made territorial gains against Somalia’s federal government in recent months, reversing the gains of African Union peacekeepers who once had pushed the militants into remote areas of the country.

Word of the deployment decision came after Hassan Sheikh Mohamud, who served as Somalia’s president between 2012 and 2017, was announced on Sunday as the winner of a protracted election.

Somalia began to fall apart in 1991 when warlords ousted dictator Siad Barre and then turned on each other. Years of conflict and al-Shabab attacks, along with famine, have shattered the country which has a long, strategic coastline by the Indian Ocean.

American soldiers deployed there in 1992 to stave off a national famine on a peacekeeping mission that lasted until their 1994 withdrawal — about five months after the humiliating “Black Hawk Down” debaclein late 1993 when Somali militiamen shot down two U.S. helicopters; 18 servicemen were killed in the crash and subsequent rescue attempt.

___

Associated Press writer Lolita C. Baldor contributed to this report.