Eritrea is fuelling the insurgency in Somalia in order to wage a proxy war against its arch-foe Ethiopia, according to the top US official for Africa.

Jendayi Frazer, the assistant secretary of state for African affairs, said that Eritrea was the largest foreign backer of guerrillas who are fiercely resisting attempts by Ethiopia and the Somali government to pacify Mogadishu.

"No insurgency group can survive without support from neighbouring countries," said Ms Frazer in Nairobi on Saturday night, just hours after becoming the highest ranking US official to visit Somalia for 14 years.

Ethiopia and Eritrea have a bitter history, and fought a brutal war over a border dispute that saw more than 70,000 people die between 1998 and 2000. Both countries remain in a state of war-readiness because Ethiopia refuses to accept the judgment of an independent boundary commission as to the location of the border.

Fears of a proxy war in Somalia have existed since the Somali Council of Islamic Courts (SCIC) took control of Mogadishu in June last year. Ethiopia, which accused the Islamists of terror links, immediately signalled its military support for the Somalia's weak Transitional Federal Government. Eritrea sided with the SCIC by supplying training and weapons, according to a UN report. Eritrea denies supporting the SCIC or insurgents.

But Ms Frazer said that Asmara was backing the remnants of the SCIC, in particular the hardline Shabaab fighters who form the core of the guerilla movement along with clan and warlord militias who are opposed to the government.

Ms Frazer said that while the "global jihadist network" was also supporting the Shabaab, Eritrea's sole motivation was "anything that will hurt" its southern neighbour.

"This is very much aimed at Ethiopia," she said.

Her comments will anger Eritrea, which accuses the US of favouring Ethiopia in the border dispute because of prime minister Meles Zenawi's status as an ally in the war on terror. During the brief war to oust the SCIC in December and January, Washington provided logistical and intelligence support to Ethiopia, and launched two air strikes aimed at fleeing Islamist fighters.

But the US is now coming under pressure at home and abroad to justify its unflinching support for Mr Zenawi's regime. An operation by Ethiopian troops to flush out insurgents from Mogadishu last weekend has drawn severe criticism after nearly 400 people were killed. The main security adviser to the European Commission warned that war crimes might have been committed by Ethiopia.

Ms Frazer said that both sides had used "excessive force", but stopped short of directly criticising Ethiopia's action. She said that the US had a "very good relationship with Ethiopia, so we don't have to discuss matters [of concern] in public".

The New York Times reported yesterday that the US allowed Ethiopia to buy arms from North Korea in January in contravention of a UN resolution sponsored by Washington - a concession that drew criticism from John Bolton, the former US ambassador to the United Nations.