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".
Hillary Clinton spoke about Somalia at the University of Nairobi
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.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.