WASHINGTON – Three weeks after the Trump administration baffled its African allies by including Chad, one of the US military’s key counterterrorism partners, in its travel ban, the country is pulling hundreds of its troops out of Niger, where four US Green Berets died in a terrorist ambush last week.

Chad has not explained publicly why it has been withdrawing its forces, which were fighting Boko Haram militants in the region as part of a multinational task force, and was first reported by Reuters. But security analysts and former defense officials said it was likely connected to its inclusion in President Donald Trump’s new travel ban, which Chad’s government said “astonished” and “baffled” them.

“Chad did say at the time that they would review their security commitments, and it makes perfect, logical sense that they are signaling to the US ‘How about you experience us backing off for a while and see how you like it?’” said Alice Hunter Friend, the Pentagon’s former principal director for African affairs who is now a senior fellow at the Center for Strategic and International Studies in Washington.

After a deadly ambush in Niger killed four US Army Green Berets last week, the need for close regional partners should be more obvious than ever, she said. The Pentagon on Thursday told reporters it believed the attack had been carried out by a self-radicalized, Islamic State-affiliated group that US forces on the ground didn't realize were nearby in such numbers.

The first known hostile-fire US casualties in Niger raised questions about whether the US has sufficient intelligence to assess the threats in the region. One of the Green Berets was missing for two days before his body was recovered. There is no evidence that the withdrawal of Chadian forces from a region hundreds of miles distant played a part in the ambush.

“The story from the past few days is how reliant the US and other countries are on our partners, and that they should not be taken for granted,” Hunter Friend said. “We really can’t accomplish much of anything in the region unless we’re working with and through African partners, who have operational knowledge of the region…(and) Chadians punch way above their weight in the counterterrorism fight.”

Experts from the State Department to humanitarian organizations were stunned when the Chad was added to the travel ban in late September. The country is home to a US military facility and just hosted an annual 20-nation military exercise with the US military's Africa Command to strengthen local forces to fight extremist insurgents. Chad's capital, N’Djamena, is the headquarters of the five-country Multinational Joint Task Force battling Boko Haram.

“They might be saying let’s pull them out and let these guys go home and collect their paychecks, while quietly communicating to the Americans, ‘Look, we do contribute, please think hard about embarrassing us internationally in the future,'” said Hunter Friend.

Residents of the Diffa region in southeastern Niger, which has suffered a series of recent attacks from Boko Haram militants, said they had seen a deterioration in security since the troops withdrew, according to local reports. There are more than 240,000 displaced people in Diffa who've fled sporadic attacks by Boko Haram. Over the last few months the terrorist group's suicide bombers have increasingly targeted refugee camps and villages there, leading to concerns that Chad’s withdrawal could lead to more.

“I’m afraid that with the reduced security presence in Diffa we could see more attacks on refugee camps,” said Jason Warner, director of the Africa profile at the Combating Terrorism Center at the US Military Academy at West Point. “Chad’s decision to withdraw troops from Niger is really not good for anyone, and a significant impediment to securing some of the goals we set out to do.”

The US counterterrorism efforts in the region had a “one-two punch in the last two weeks, with the Niger attack and then this Chad development,” he said, adding that it was a “reasonable assumption” that its military withdrawal was meant to send a message.

“We have seen real evidence that Chad’s inclusion in the travel ban has not sat well, and they indicated there could be a backlash,” he said.

In the days after the travel ban was announced, Chadian diplomats had to shoot down heavily trafficked rumors on social media that the US embassy in its capital, N’djamena, was closing. Mali’s President Ibrahim Boubacar Keita, who heads a group of five countries in Africa’s Sahel region, called on the US to change its mind, warning that the travel ban could “affect the commitment of Chad, which has until now shown itself to be a key partner in the fight against terrorism.”

The African Union also released a statement expressing its “bewilderment at the imposition of the unjust travel ban on Chad...in particular, given its important role in the fight against terrorism.”

The Trump administration said it added Chad to the travel ban because it "does not adequately share public-safety and terrorism-related information," and "several terrorist groups are active within Chad or in the surrounding region.” But it was not clear why it was singled out when its neighbors have the same issues, but aren't as close military partners to the US and France.

The US has been quietly building up its presence in the region, deploying around 800 soldiers to Niger and building a $100 million drone base in Agadez, the largest city in central Niger. In the process, they have leaned on Chadian forces to help battle extremists; the Chadian military is widely seen as the most effective military partner in the region after their success fighting Islamist rebels in northern Mali in 2013.

Boko Haram’s efforts to carve out an Islamic caliphate in the Lake Chad region have left 20,000 people dead since 2009, with 2.7 million forced to flee their homes in Chad, Cameroon, Niger and Nigeria.

Neither State Department nor Pentagon officials responded to a request for comment.