Washington (Bostonglobe + DIPLOMAT.SO) – 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 militants in the anarchic nation.

Hundreds of US 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 described by US and African officials and international monitors of the conflict, is partly designed to avoid repeating that debacle, which led to the deaths of 18 US soldiers. But it carries enormous risks — including more US casualties, botched airstrikes that kill civilians, and the potential for the United States to be drawn even more deeply into a troubled country that has stymied all efforts to fix it.

But the Somalia campaign is a blueprint for warfare that President Obama has embraced and will pass along to his successor. It is a model the United States now employs across the Middle East and North Africa — from Syria to Libya — despite the president’s stated aversion to American “boots on the ground” in the world’s war zones. This year alone, the United States has carried out airstrikes in seven countries and conducted Special Operations missions in many more.

US officials said the White House had quietly broadened the president’s authority for the use of force in Somalia by allowing airstrikes to protect US and African troops as they combat fighters from Al Shabab, a Somali-based militant group that pledges 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 US forces are being deployed on the front lines in Somalia that they face imminent threats from Al Shabab.

America’s role in Somalia has expanded as Al Shabab has become bolder and more cunning. The group has attacked police headquarters, bombed restaurants, killed Somali generals, and stormed fortified bases used by African Union troops. In January, Al Shabab fighters killed more than 100 Kenyan troops.

The group carried out the 2013 attack at the Westgate mall, which killed over 60 people and wounded over 175 in Nairobi, Kenya. More recently it has branched into more sophisticated terrorism, including nearly downing a Somali airliner in February with a bomb hidden in a laptop computer.

About 200 to 300 US Special Operations troops work with soldiers from Somalia and other African nations like Kenya and Uganda to carry out over a half-dozen raids per month, according to senior US 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, US troops working with Somali forces often interrogate prisoners at temporary screening facilities before detainees are transferred to more permanent Somali-run prisons, US 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 in 2016 — including three operations in September — up from five in 2015, according to data compiled by the New America Foundation, a Washington think tank. The strikes have killed about 25 civilians and 200 suspected militants, the group found.

The strikes have had a mixed record. In March, a US airstrike killed more than 150 Al Shabab fighters at what military officials called a “graduation ceremony,” one of the single deadliest US airstrikes in any country in recent years. But an airstrike last month killed more than a dozen Somali government soldiers, who were US allies against Al 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 Ash 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 US presence in Somalia would inevitably lead to an escalation of the air campaign.

“It is clear that US 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 US advisers will periodically be in positions where Al Shabab is about to launch an attack.”

Peter Cook, the Defense Department 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 Obama sends to Congress about US conflicts overseas.

The Somalia passage in the June 2015 notification is terse, saying US troops “have worked to counter the terrorist threat posed by al-Qaida and associated elements of Al Shabab.”

This past June, however, the president told Congress that the United States had become engaged in a more expansive mission.

Besides hunting members of al-Qaida and Al Shabab, the notification said, US 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.”

US airstrikes, it said, were carried out in defense of the African troops and in one instance because Al Shabab fighters “posed an imminent threat to US and AMISOM forces.”

Related