Britain is to back a £50million fund to improve security in Somalia.
David Cameron said the international community had to to 'get right behind' the rebuilding of the war-torn country or risk fuelling terrorism and mass migration.
After hosting an international conference in London, the Prime Minister warned radicalism was 'poisoning young Somali minds' which posed a threat to UK security.
Britain, China, the United States and South Africa are among the countries which have agreed to contribute to the £50 million funding pot.
The money will be used to build up the army, police force and strengthen maritime security.
Mr Cameron said there had been 'remarkable' progress since the first meeting of world leaders last year but warned that 'huge challenges' remain.
He told a press conference: 'If we ignore it we will be making the same mistakes in Somalia that we made in Afghanistan in the 1990s. I'm not prepared to let that happen.'
Almost 50 governments and global bodies such as the IMF gathered at the conference to hear Somali president Hassan Sheikh Mohamud outline his plans to stabilise the country after two decades of brutal civil war.
A year on from the last such meeting in London the world was 'seeing the beginnings of a new future for Somalia', Mr Cameron said.
Extremism was 'in retreat' as the al Shabaab militias were driven from more towns, piracy attacks were down 80 per cent and a 'proper, legitimate' government had been put in place alongside a clan-selected parliament, he noted.
The capital Mogadishu is starting to return to more normal life - with petrol stations, supermarkets and international flights returning for the first time since 1991 - despite continued terrorist attacks by extremists such as a suicide car bomb which killed several civilians last week.
Ending poverty and the lure of payment by extremists was 'the best antidote to extremism', he said.
But help had to go well beyond humanitarian aid, he said, pledging £10 million of UK support for developing Somalia's armed forces, £14.5 million to boost police numbers and train judges and financial support for a maritime radio system to counter piracy.
'I hope that others here will contribute too and the countries in the region will stay the course and work with Somalia while it builds up its own forces.'
At present, it relies on the help of Ethiopian and African Union military support to combat al Shabaab.
The PM said the international community had to send a 'strong signal' to world financial institutions to help Somalis deal with debt and get access to finance now it has a government recognised by the US and other key players for the first time in more than two decades.
And al Shabaab extremists who renounced violence should be able to join the political process.
Earlier Mr Cameron had talks with young members of the Somali diaspora and said he wanted to make their country sufficiently safe for those who wished to return and help with the rebuilding process.
Source:
http://www.dailymail.co.uk/news/article ... ds-newsxml