WASHINGTON — The Obama administration has intensified a clandestine war in Somalia over the past year, using Special Operations troops, airstrikes, private contractors and African allies in an escalating campaign against Islamist militants in the anarchic Horn of Africa nation.
Hundreds of American troops now rotate through makeshift bases in Somalia, the largest military presence since the United States pulled out of the country after the “Black Hawk Down” battle in 1993.
The Somalia campaign, as it is described by American and African officials and international monitors of the Somali conflict, is partly designed to avoid repeating that debacle, which led to the deaths of 18 American soldiers. But it carries enormous risks — including more American casualties, botched airstrikes that kill civilians and the potential for the United States to be drawn even more deeply into a troubled country that so far has stymied all efforts to fix it.
American officials said the White House had quietly broadened the president’s authority for the use of force in Somalia by allowing airstrikes to protect American and African troops as they combat fighters from the Shabab, a Somali-based militant group that has proclaimed allegiance to Al Qaeda.
In its public announcements, the Pentagon sometimes characterizes the operations as “self-defense strikes,” though some analysts have said this rationale has become a self-fulfilling prophecy. It is only because American forces are now being deployed on the front lines in Somalia that they face imminent threats from the Shabab.
America’s role in Somalia has expanded as the Shabab have become bolder and more cunning. The group has attacked police headquarters, bombed seaside restaurants, killed Somali generals and stormed heavily fortified bases used by African Union troops. In January, Shabab fighters killed more than 100 Kenyan troops and drove off with their trucks and weapons.
The group carried out the 2013 attack at the Westgate mall, which killed more than 60 people and wounded more than 175 in Nairobi, Kenya. More recently it has branched into more sophisticated forms of terrorism, including nearly downing a Somali airliner in February with a bomb hidden in a laptop computer.
About 200 to 300 American Special Operations troops work with soldiers from Somalia and other African nations like Kenya and Uganda to carry out more than a half-dozen raids per month, according to senior American military officials. The operations are a combination of ground raids and drone strikes.
The Navy’s classified SEAL Team 6 has been heavily involved in many of these operations.
Once ground operations are complete, American troops working with Somali forces often interrogate prisoners at temporary screening facilities, including one in Puntland, a state in northern Somalia, before the detainees are transferred to more permanent Somali-run prisons, American military officials said.
The Pentagon has acknowledged only a small fraction of these operations. But even the information released publicly shows a marked increase this year. The Pentagon has announced 13 ground raids and airstrikes thus far in 2016 — including three operations in September — up from five in 2015, according to data compiled by New America, a Washington think tank. The strikes have killed about 25 civilians and 200 people suspected of being militants, the group found.
The strikes have had a mixed record. In March, an American airstrike killed more than 150 Shabab fighters at what military officials called a “graduation ceremony,” one of the single deadliest American airstrikes in any country in recent years. But an airstrike last month killed more than a dozen Somali government soldiers, who were American allies against the Shabab.
Outraged Somali officials said the Americans had been duped by clan rivals and fed bad intelligence, laying bare the complexities of waging a shadow war in Somalia. Defense Secretary Ashton B. Carter said the Pentagon was investigating the strike.
Some experts point out that with the administration’s expanded self-defense justification for airstrikes, a greater American presence in Somalia would inevitably lead to an escalation of the air campaign.
“It is clear that U.S. on-the-ground support to Somali security forces and African Union peacekeepers has been stepped up this year,” said Ken Menkhaus, a Somalia expert at Davidson College. “That increases the likelihood that U.S. advisers will periodically be in positions where Al Shabab is about to launch an attack.”
Peter Cook, the Department of Defense spokesman, wrote in an email, “The DoD has a strong partnership with the Somali National Army and AMISOM forces from Djibouti, Ethiopia, Kenya, Uganda and Burundi operating in Somalia. They have made steady progress pressuring Al Shabab.”
The escalation of the war can be seen in the bureaucratic language of the semiannual notifications that Mr. Obama sends to Congress about American conflicts overseas.
The Somalia passage in the June 2015 notification is terse, saying American troops “have worked to counter the terrorist threat posed by al-Qa’ida and associated elements of al-Shabaab.”
In June, however, the president told Congress that the United States had become engaged in a more expansive mission.
Besides hunting members of Al Qaeda and the Shabab, the notification said, American troops are in Somalia “to provide advice and assistance to regional counterterrorism forces, including the Somali National Army and African Union Mission in Somalia (AMISOM) forces.”
American airstrikes, it said, were carried out in defense of the African troops and in one instance because Shabab fighters “posed an imminent threat to U.S. and AMISOM forces.”
At an old Russian fighter jet base in Baledogle, about 70 miles from the Somali capital, Mogadishu, American Marines and private contractors are working to build up a Somali military unit designed to combat the Shabab throughout the country.
Soldiers for the military unit, called Danab, which means lightning in Somali, are recruited by employees of Bancroft Global Development, a Washington-based company that for years has worked with the State Department to train African Union troops and embed with them on military operations inside Somalia.
Michael Stock, the company’s founder, said the Danab recruits received initial training at a facility in Mogadishu before they were sent to Baledogle, where they go through months of training by the Marines. Bancroft advisers then accompany the Somali fighters on missions.
Mr. Stock said the goal was to create a small Somali military unit capable of battling the Shabab without repeating the mistakes in Afghanistan and Iraq, where the United States spent hundreds of millions of dollars trying to build up large armies.
Still, American commanders and their international partners are considering a significant expansion of the training effort to potentially include thousands of Somali troops who would protect the country when African Union forces eventually left the country.
Maj. Gen. Kurt L. Sonntag, the commander of the American military’s task force in Djibouti, the only permanent American base in Africa, said the proposed training plan would increase and enhance the Somali national security forces, including the army, national guard and national police.
“The specific numbers of forces required is currently being assessed,” General Sonntag said. He added that it must be large enough to protect the Somali people but “affordable and sustainable over time, in terms of Somalia’s national budget.”
Independent experts and aid organizations say the Somali Army is still largely untrained, poorly paid and poorly equipped, and years away from coalescing regional militias into a unified army.
American policy makers tried to avoid direct involvement in Somalia for years after the Black Hawk Down episode. But in the years after the Sept. 11, 2001, attacks, Special Operations troops and the Central Intelligence Agency began paying Somali warlords to hunt down Qaeda operatives in the country.
In 2006, the United States gave clandestine support to Ethiopian troops invading the country to overthrow an Islamist movement that had taken control of Mogadishu. But the brutal urban warfare tactics of the Ethiopian troops created support for an insurgent movement that called itself Al Shabab, which means “The Youth.”
American involvement in Somalia was intermittent for several years afterward, until the Westgate attack refocused Washington’s attention on the threat the Shabab posed beyond Somalia.
The Shabab still control thousands of square miles of territory across Somalia. A Somali university student who travels in and out of Shabab areas said the group’s fighters were becoming increasingly suspicious, even paranoid, checking the phones, cameras, computers and documents of anyone passing through their territory, constantly on guard for another American attack. He said Shabab fighters were becoming younger, with a vast majority under 25 and many as young as 10.
American law enforcement officials think that the bomb that nearly brought down the commercial jet in February was most likely made by a Yemeni who is believed to have constructed other laptop bombs in Somalia. Pictures from an airport X-ray machine show the explosive packed into the corner of the laptop, next to a nine-volt battery. Several aviation experts said that the bomb was obvious and that airport security officials in Mogadishu might have intentionally allowed it through.
The bomb exploded about 15 minutes after takeoff, punching a hole through the fuselage and killing the man suspected of carrying the bomb on board, though the pilot was able to land safely. Aviation experts said that if the bomb had exploded a few minutes later, with the cabin fully pressurized, the fuselage would have most likely blown apart, killing all of the approximately 80 people on board.