The United States is deploying "a few dozen" troops to Somalia to assist the national army and conduct unspecified security operations, a US military spokeswoman said on Saturday - the largest such deployment to the Horn of Africa country in about two decades.

Samantha Reho, spokeswoman for the US Africa Command based in Germany, said the soldiers from the 101st Airborne Division, a light infantry unit specialised in air assaults, will mainly train and equip Somalia's army "to better fight al-Shabab", an armed group fighting to overthrow the country's internationally recognised government.

They will also conduct "security force assistance", she told the AFP news agency, confirming a report by Voice of America.

REPORTER'S NOTEBOOK: Filming al-Shabab with a drone

"For operational security issues, we will not discuss specifics of military efforts nor speculate on potential future activities or operations," Reho said, declining to say precisely how many troops were being sent.

The US in recent years has sent a small number of special operations forces and counter-terror advisers to Somalia, and President Donald Trump recently approved an expanded military role there.

Somalia's fragile central government is still propped up by the international community and a 22,000-strong African Union (AU) peacekeeping force after nearly three decades of civil war.

A Somali in America - Al Jazeera World

While al-Shabab fighters have lost large swaths of territory and were forced out of the capital, Mogadishu, by AU troops in 2011, they have been on the offensive in recent months, retaking strings of towns in south and central Somalia.

The group also continues to launch attacks in Mogadishu and the countryside, and have claimed responsibility for major attacks in East Africa, including one at Garissa University in neighbouring Kenya in April 2015 that killed 148 people.

In February 2016, al-Shabab also claimed responsibility for the bombing of an airliner that made an emergency landing with a gaping hole in the fuselage shortly after taking off from Mogadishu.

The armed group has threatened a "merciless" war against the new administration of President Mohamed Abdullahi Mohamed, who goes by the nickname "Farmajo". He took office in February.

It announced this week that its recent escalation of deadly attacks in Mogadishu and elsewhere is in "doubled response" to Trump's approval of expanded US military efforts.

On April 9, Somalia's new military chief survived a suicide car bombing following his swearing-in, in at attack that killed at least 13 people. A day later, a suicide bombing at a military academy in Mogadishu killed at least five soldiers.

The most notorious US military operation in Somalia was in 1993, when an ill-fated attempt to snatch militia leaders led to two Black Hawk helicopters being shot down in Mogadishu. A chaotic rescue was mounted, resulting in hundreds of deaths, including those of 18 US soldiers.

OPINION: Why are African men and women still fleeing to Yemen?

Pressure is growing on Somalia's army to assume full security for the country as the AU force plans to leave by the end of 2020. Last month, the head of the mission said Somalia's army had been unable to take charge as expected.

The AU force will begin withdrawing in 2018, "and if this departure begins prior to Somalia having capable security forces, large portions of Somalia are at risk of returning to al-Shabab control or potentially allowing ISIS to gain a stronger foothold in the country", the head of the US Africa Command, Commander General Thomas Waldhauser, said last month.

Inside Story - Why does Somalia matter?

Source: News agencies