US Secretary of State Hillary Clinton has warned that the US will "take action" against Eritrea if it does not stop supporting militants in Somalia.
She said after talks with Somali President Sheikh Sharif Sheikh Ahmed in Kenya's capital, Nairobi, that Eritrea's actions were "unacceptable".
She also said the US would expand support for Somalia's unity government.
Eritrea denies supporting Somalia's al-Shabab militants, who are trying to overthrow Somalia's government.
Al-Shabab is growing in strength and 250,000 Somalis have fled their homes in fighting between militants and government forces over the past three months.
Mrs Clinton was holding the talks with the UN-backed Somali leader, a moderate Islamist, on the second day of her African tour.
At a joint news conference with him after the meeting, she said: "It is long past time for Eritrea to cease and desist its support of al-Shabab and to start being a productive rather than a destabilising neighbour.
"We are making it very clear that their actions are unacceptable. We intend to take action if they do not cease."
She added: "There is also no doubt that al-Shabab wants to obtain control of Somalia to use it as a base from which to influence and even infiltrate surrounding countries and launch attacks against countries far and near."
Mrs Clinton said if al-Shabab obtained a haven in Somalia "it would be a threat to the United States".
The US has ruled out sending its forces to fight insurgents in Somalia.
But the AFP news agency quoted a state department official as saying on Thursday that the US supply of arms and ammunition to Somalia would be doubled from 40 tonnes to 80.
Eritrean officials have repeatedly denied supporting al-Shabab, calling the allegations a "fabrication" of US intelligence.
Several Somali Islamist groups operated from Eritrea after being ousted from the capital, Mogadishu, when Ethiopian troops entered Somalia in 2006.
Before the talks on Thursday, Mrs Clinton honoured the victims of the August 1998 attacks on the US embassies in Kenya and Tanzania, in a wreath-laying ceremony in Nairobi.
More than 220 people were killed and 5,000 injured in the first major attack by al-Qaeda on US targets.
AP news agency quoted her as saying that the embassy site was a reminder of "the continuing threat of terrorism, which respects no boundaries, no race, ethnicity or religion, but is aimed at disrupting and denying the opportunity of people to make their own decisions and to lead their own lives".
There are reports that al-Shabab - the Somali Islamist group which favours strict Islamic law and is accused of links to al-Qaeda - is gaining support from militants around the world.
Earlier this week, police in Australia arrested several men, charging them with planning suicide attacks on a base in Sydney and saying they were linked to al-Shabab.
The BBC's Will Ross in Nairobi says President Ahmed needs all the support he can get. Pro-government forces are only in control of a small section of the Somali capital, Mogadishu.
Our correspondent points out it is far too dangerous for the American secretary of state to venture into Somalia, as the fighting continues.
Somalia's foreign minister told the BBC's Network Africa programme that Washington's support for his government was a "golden opportunity".
"It is absolutely clear that the people of Somalia are tired... sick and tired of war, sick and tired of chaos," he said.
The US admits it has supplied pro-government forces in Somalia with over 40 tonnes of weapons and ammunition this year, and another delivery of weapons is predicted, says our correspondent.
But there are growing fears that the Horn of Africa country - which has been without an effective central government since 1991 - risks becoming a haven for terrorists.
On Wednesday, Mrs Clinton held talks in Nairobi with Kenya's president and prime minister.
America's top diplomat described as "disappointing" Kenya's failure to investigate a bout of violence that left at least 1,300 people dead after the disputed December 2007 presidential election.
Addressing African leaders at Wednesday's economic summit, Mrs Clinton said the continent had "enormous potential for progress".
But she stressed that harnessing that potential would require democracy and good governance.
During her 11-day trip Mrs Clinton will also visit South Africa, Nigeria, Angola, Liberia, the Democratic Republic of Congo and Cape Verde.