TRIPOLI, Libya — The US Special Operations forces expected a warm welcome when they landed at the Libyan air base where an allied militia was stationed. Instead, armed men from another militia at the base threatened to detain the commandos, forcing the Americans to flee.
The episode, on Dec. 14, highlighted the difficulties faced by the Obama administration as it engages in a search across Libya to find armed groups that can act as a ground force against the country’s increasingly potent branch of the Islamic State.
US and Libyan officials said the sudden departure of the group of 20 US commandos from the Al Watiya air base last month was the result of a miscommunication between the militias stationed there. But the episode laid bare the lack of central authority in Libya, with no single government in charge and an army barely able to exert control over its forces.
Counterterrorism officials regard the Libyan branch as the Islamic State’s most dangerous affiliate, one that is expanding its territory and continuing to mount deadly attacks, including several this month.
But to stop its advance, the United States and its European allies have been forced to court unreliable allies from among a patchwork of Libyan militias that remain unaccountable, poorly organized, and divided by region and tribe.
The search carries particular risks for the Obama administration, which once relied on local militias to help protect the US diplomatic compound in the northeastern city of Benghazi. They failed to provide protection when the compound was overrun by militants in September 2012, an attack that led to the deaths of the United States ambassador, J. Christopher Stevens, and three other Americans.
Analysts also warn that any foreign effort to empower individual proxy forces could fuel new rivalries as the United Nations is trying to bring together Libya’s warring factions after years of civil war that followed the toppling of Moammar Gadhafi in 2011.
The mix-up at the base, about 70 miles from Tripoli, comes at a time of growing alarm in Washington and in European capitals about the rise of the Islamic State’s wing in Libya. American spy agencies say that the Islamic State, also known as ISIS or ISIL, has in the past few months redirected several hundred foreign fighters originally bound for Syria to its camps in Libya.
In November, a US airstrike killed the Islamic State’s senior leader in Libya, Abu Nabil, an Iraqi national who led Al Qaeda operations in western Iraq from 2004 until 2010, US officials said.
“The ISIL branch in Libya is one that is taking advantage of the deteriorating security conditions in Libya, putting itself in the position to coordinate ISIL efforts across North Africa,” Nicholas J. Rasmussen, director of the National Counterterrorism Center, said in an interview on C-SPAN last month.
The United States is under pressure after a series of failed efforts to train and equip rebels in the region, particularly in Syria. The Pentagon abandoned a plan last year to arm and train newly formed groups of opposition fighters, and switched to another approach of arming and assisting existing Syrian rebels fighting the Islamic State.
In eastern Syria on Monday, Islamic State militants launched a fresh offensive, taking advantage of a sandstorm to capture new areas from government forces near the city of Deir el-Zour, opposition activists said.
The Britain-based Syrian Observatory for Human Rights said the militants captured areas just north of the city, including an army base known as the ‘‘Saiqa Camp.’’ Opposition activist Omar Abu Leila reported that Islamic State fighters had also captured the entire village of Ayash.
There are several armed factions in Libya other than the Islamic State, but each is at best an awkward partner to the West.
The “Libyan national army” run by General Khalifa Hifter is just one of the groups vying for power. Hifter has authorization from a regional Parliament and has sought to rule Libya, but he has been unable to fully control even Benghazi, a few miles away from his headquarters.
Over the last year, teams of Special Operations forces from the US military’s Africa Command have traveled to Libya to gather information on the ground and assess each faction’s fighting capability and ability to work with the United States and its allies.
John Kirby, the State Department spokesman, said US officials have engaged with a wide group of Libyans and the US troops’ planned meeting at Watiya was “not an endorsement of any specific group.”