Clive Dennis, 45, was held at the Aden Adde International airport in the shattered country’s capital Mogadishu.
An official from Somalia’s Transitional Federal Government said the Jamaica-born Briton travelled on a UK passport from Nairobi.
Somali director of immigration Abdullahi Gafow Mohamud told the Iranian broadcast network Press TV that Dennis was held at the airport over a visa offence and told officials he hoped to live in the port town of Kismayo.
General Mohamud said: ‘After a short interrogation, he claimed that he came from London via Nairobi and he was heading to Kismayo.’
The Somalia Report news website quoted government spokesman Abdirahman Omar Osman Yarisow, who said Dennis had told immigration bosses he had travelled to the war-torn Horn of Africa nation ‘to help Islam’.
The publication reported: ‘Dennis is suspected of having links to al-Qaeda, according to Yarisow, although it is unlikely that an al-Qaeda militant would choose to enter the country in such a manner.’
Somalia Report added that the British citizen was allegedly caught in possession of drugs and a variety of knives.
Press TV reported that other items in his baggage allegedly included military-grade rope, credit cards and daggers.
Dennis’ reported arrest makes him the latest in a string of Britons held in Somalia or Kenya over suspected links to al-Shabaab, which is backed by al-Qaeda.
Last month the UK hosted a major international conference on Somalia in the hope of finding new solutions to the crisis which has engulfed the country for more than two decades.
However security experts have warned dozens of radicalised Muslims could have travelled from the UK to join al-Shabaab.
Terror suspect Jermaine Grant, 29, from London, was arrested in Kenya in December and is due to stand trial over an alleged terror plot.
Police have said they believed the Muslim convert could have been working in the port city of Mombasa alongside fellow Briton Samantha Lewthwaite, 28.
The mother of three is the widow of London 7/7 suicide bomber Jermaine Lindsay.
She is believed to have travelled to Kenya last year from her home in Aylesbury and is suspected of helping to fund terrorism.
Al-Shabaab has controlled parts of Somalia for years since the effective collapse of the country’s government.
The militant organisation enforces an extreme form of Sharia law and has organised a string of terrorist atrocities.
Last October Kenya sent troops across the border into Somalia in a bid to flush out the militia.
The Kenyan soldiers have since joined an African Union peace mission in the country.