By Edmund Blair

NAIROBI (Reuters) - A consignment of aid shipped by the U.N. World Food Programme (WFP) through Eritrea's main port this month was the first in a decade and the latest sign of Asmara trying to rebuild ties with the outside world, diplomats said.

Eritrea, which blames U.N. sanctions for driving it into isolation, has been engaging more deeply with the European Union over the migrant crisis and deepening ties with Gulf Arab states that lie across the Red Sea.

The poor but fiercely self-reliant nation, which won independence from Ethiopia in 1991 and fought a war with its former ruler after that, has snubbed some international aid in the past, saying it wanted to avoid a culture of dependence.

The WFP scaled back its presence ten years ago after a row over distribution of food assistance, while continuing with a few small projects in Eritrea, diplomats said.

But the shipment this month of 1,100 tonnes of sorghum for South Sudan through its main Massawa port was the first cargo to land in Eritrea since 2006.

WFP officials called it a "pilot shipment" to test Massawa's efficiency and cost as a route for aid to South Sudan, compared with other routes through Sudan or Kenya.

It was also a test of the under-used Eritrean port as an alternative to the congested facilities in neighboring Djibouti, which has been used to supply aid to South Sudan and Yemen on the other side of the Red Sea.

One WFP official involved in arranging the shipment said Eritrea cooperated with the effort, ensuring the consignment was unloaded swiftly, although he said it was more expensive than the Port Sudan route.

The official said the Eritrean authorities had said they would look at the possibility of reducing costs if the route was used in future.

One senior Western diplomat in Asmara said the operation indicated "another little opening" in Eritrea's bid to improve international relations.

"The direction of travel is clear and consistent but it is slow and tentative and reversible," the diplomat said.

Despite improving ties with some U.N. bodies, Asmara has refused to cooperate with a U.N. Commission of Inquiry that this month accused its leaders of committing crimes against humanity.

Eritrea has vehemently denied the charges, saying the commission is politically motivated.

"We are encouraging continued and expanded engagement of Eritrea and the U.N," said another Western diplomat in Asmara.

(Additional reporting by Ed Cropley; Writing by Edmund Blair; Editing by Ed Cropley and Richard Balmforth)