It has been working with US Delta Force directing air strikes against the insurgents by American jets based in Djibouti.
A second much larger force of UK and European soldiers is training Somali troops ready for a major offensive later this year.
The British soldiers are drawn from infantry regiments across the Army and are also based near Mogadishu.
More troops from the UK, Holland and the US are in nearby Uganda training soldiers who will serve with the African Union Force in Somalia later this year.
PM David Cameron pledged military support for the United Nations-backed mission last September with a 70-strong training team.
Two months ago 26 soldiers from the 4th Battalion the Yorkshire Regiment were sent to Uganda to mentor troops.
Major David Prew of the Yorkshire Regiment said: “Every individual that deployed had a vital role to play.
“Their actions had a direct result on the Uganda People’s Defence Force’s progression and their effectiveness for deployment to Somalia.”