The top US diplomat for Africa has urged Somalia's interim government to create a lasting ceasefire, as violence threatens to derail reconciliation.
Hundreds of civilians have died and up to 100,000 have fled the capital
Jendayi Frazer met the president and prime minister in the southern city of Baidoa, seat of the interim government.
Ms Frazer is the highest ranking US official to visit Somalia since 1994.
Her visit comes amid a fragile truce in the capital, Mogadishu, after a fierce assault by Somali and Ethiopian forces against Islamists and clan militias.
Ms Frazer told the BBC that a permanent ceasefire should be established "as quickly as possible" through political dialogue between the government and affected communities.
She said there were elements in Somalia, whom she described as global jihadists, with a political ideology intent on making the country ungovernable.
"I think you can bring clan militia, warlord elements in to some type of reconciliation and dialogue but those who are committed jihadists - negotiation with them is not going to lead to a reconciliation process," she said.
She also accused neighbouring Eritrea of destabilising Somalia, by backing the insurgents.
Eritrea has long denied accusations that it gave military and other support to Somalia's Islamists.
Armed criminals could be dealt with when more law and order was established - when the government had a better trained and inclusive police force and army, she added.
African Union (AU) troops are supposed to be replacing Ethiopian soldiers, who stepped in at the end of 2006 to support a Somali government campaign to oust Islamists controlling the capital.
Ms Frazer said the AU forces were important in helping the government stabilise the situation but that Ethiopia should not withdraw its troops too early and risk "a security vacuum".
The unannounced visit of the US assistant secretary of state for African affairs comes on the sixth day of the ceasefire.
A national reconciliation conference is scheduled for 16 April.
The four-day assault last month led to some of the heaviest fighting in Mogadishu for 15 years.
Hundreds of civilians are reported to have died in the fighting and up to 100,000 fled the capital, according to the UN.
Fighters linked to the Hawiye clan, which controls the capital, and militant Islamists are reported to be keeping vigil at their strongholds in Mogadishu.