The European Union has agreed to set up a mission in Uganda to train Somali government forces who are battling Islamist fighters in their homeland.
The mission, expected to be led by Spain and involving about 100 troops, is likely to begin in the second quarter of this year, EU foreign ministers decided at a meeting in Brussels on Monday.
"The EU should ... continue to help stabilise Somalia by providing support to vital and priority areas such as the security sector, development, assistance to the population and capacity-building support," the ministers said in a statement.
"In this context, the council agreed to set up a military mission to contribute to training of Somali security forces."
Some EU member states expressed concern that training Somali troops and providing them with guns could cause more problems than it solves if there were not long-term commitments in place to pay them and give them institutional support.
Those issues, including the vetting of trainees and the monitoring of the force once it is back in Somalia, must be addressed before the mission gets under way, the ministers said.
Spain and France have already committed soldiers to the training team and other countries are expected to follow, including Britain, Slovenia, Greece and Hungary.
Foreign governments have stepped up efforts to stabilise the country in the past three or four years, following a major rise in piracy originating there.
However, the UN-backed government exercises little effective control in the country, except over a small area of the capital, Mogadishu.
An African Union force on the ground protects key institutions but the government says it needs a larger contingent of its own capable, reliable troops.
The EU mission is expected to train around 2,000 Somali troops and complement other missions, bringing the total of better-trained Somali soldiers to around 6,000.
The bloc said its mission would be conducted in co-ordination with Somali's transitional government, Uganda, the African Union, the United Nations and the United States.
Since the start of 2007, fighting in Somalia has killed 20,000 civilians and uprooted more than 1.5 million from their homes.