A former American soldier with specialist intelligence training faces terror charges after allegedly trying to join Somalia's Al-Qaeda-linked Shebab militants, US justice officials said Monday.

Craig Baxam, 24, secretly converted to Islam after perusing an Islamic religious website while serving in South Korea and quit the army days later in July 2011 to return to the United States, theJustice Department said.

Baxam was apprehended on December 23 aboard a bus near the Kenyan city of Mombasa after cashing out his savings and taking his remaining $600 to $700 to give the Shebab as an introductory offer, the affidavit said.

The suspect, who had served previously in Iraq after completing eight months of advanced training for cryptology and intelligence, was due to be arraigned at a court near Washington later Monday.

"The complaint alleges that Craig Baxam intended to travel to Somalia and join the terrorist organization Al-Shebab," US Attorney Rod Rosenstein said in a written Justice Department statement.

"Mr Baxam was caught in Kenya before he reached Somalia, and there is no allegation that anyone assisted him."

Baxam, originally from Laurel, a town in Maryland near the US capital, was questioned by Kenyan anti-terrorism police and the FBI in Nairobi before being put on a plane back to the United States to stand trial.

If found guilty, Baxam, who joined the army in 2007, faces a maximum sentence of 15 years in prison followed by three years of supervised release.

In October, a Shebab suicide bomber detonated an explosives-laden truck in the Somali capital Mogadishu, killing more than 70 people and wounding more than 100 more.

The bombing was the deadliest single attack in Somalia by the Shebab, who launched a bloody uprising in 2007 against the Western-backed transitional government.

The hardline insurgents, who are accused of having links to Al-Qaeda, control large parts of southern Somalia but are facing increasing pressure from regional armies and government forces.

Kenyan troops are battling the rebels in the far south, Ethiopian forces are in the south and west, while Ugandan and Burundian soldiers in the African Union force in Mogadishu are supporting government efforts.