WASHINGTON (Reuters) - The U.S. military will withdraw hundreds of troops focused on counterterrorism operations in Africa over the next several years to support the Pentagon’s increased focus on countering threats from China and Russia, officials said on Thursday.

Earlier this year, the U.S. military put countering China and Russia at the center of a new national defense strategy, the latest sign of shifting priorities after more than a decade and a half of focusing on the fight against Islamist militants.

“This realignment specifically projects to reduce forces by about 10 percent over the next several years - representing a fraction of the overall 7,200 DoD personnel operating in Africa,” Commander Candice Tresch, a Pentagon spokeswoman, told Reuters.

Tresch said the cuts would leave “counter-violent extremist organization” activities largely untouched in several countries, including Somalia, Djibouti and Libya.

In other parts of the region, including West Africa, the emphasis would shift from “tactical assistance to advising, assisting, liaising and sharing intelligence.”

A U.S. official, speaking on condition of anonymity, said the reduction of troops would likely take place over three years and could include countries like Kenya, Cameroon and Mali.

The United States’ military role on the African continent has received increased attention after an ambush last year in Niger, carried out by a local Islamic State affiliate, which killed four U.S. soldiers.

The Pentagon is concerned about an increasingly resurgent Russia, which has flexed its military muscle in conflicts like those in Ukraine and Syria. The Pentagon is also increasingly focused on China’s growing assertiveness in areas like the South China Sea.

The Pentagon move comes as China and Russia look to increase their influence in Africa.

During the Cold War, the Soviet Union forged close military and diplomatic ties with many African countries. Russia is now trying to revive some of the relationships that lapsed after the Soviet Union’s collapse.

Since Western nations sanctioned Russia for annexing Crimea in 2014, Moscow has signed 19 military cooperation deals in sub-Saharan Africa, including with Ethiopia, Nigeria and Zimbabwe, according to its foreign and defense ministries and state media.

China has long had a major economic presence in Africa, but has shied away from military involvement. However, last year, it went a step further, opening its first military base outside China in Djibouti.

A congressionally mandated report by former U.S. officials released earlier this week said that the military did not have sufficient resources to fund the military’s needs and the goals set out by U.S. Defense Secretary Jim Mattis earlier this year.

Separately on Thursday, the military said two U.S. Navy SEALs and two Marines were charged in the death of an Army Green Beret in Mali in 2017. The charge sheets accuse the troops of breaking into Army Staff Sergeant Logan Melgar’s bedroom, tying him with duct tape and strangling him by placing him in a chokehold.