U.N. Secretary-General Ban Ki-moon said Saturday that international support for the current Somalia government was the only chance to stabilize the chaotic country.
Ban was speaking at an international U.N.-backed conference which resulted in a pledge to work with the government of President Sheikh Sharif Ahmed to end the cycle of lawlessness and violence which plagues Somalia.
The fragile Western-backed transitional government of President Sheikh Sharif Ahmed only controls a small area of Mogadishu, with the help of African Union troops, and faces near daily attacks from Islamist rebels.
"The Transitional Federal Government represents Somalia's best chance in years to escape from the endless cycle of war and humanitarian disaster," Ban told the Political, Security and Reconstruction Conference for Somalia in Istanbul.
"The only way to restore stability is to support this government -- both in its reconciliation efforts and, where necessary, its fight against extremism."
Ban voiced specific support for Sheikh Ahmed, saying he needed to be in power and needed to strengthen his leadership.
The conference declaration said it was critical to put a renewed emphasis on economic recovery, appealing for the timely disbursement of funds pledged to Somali security institutions.
It also expressed grave concern over the increase in piracy off the coast of Somalia. For its part, the transitional government pledged dialogue and reconciliation efforts.
The government is beset by near-daily attacks from the Islamist al Shabaab group, which Washington terms as al Qaeda's proxy in the region, and Hizbul Islam, another hardline group.
Ban called for the authorities in Somalia to overcome their differences.
"I urge the Somali authorities to demonstrate the will and commitment to work together, resolve their internal disputes, and unite against the threat of extremism," he said.
Speaking separately at the conference, Ahmed said work was under way to elect a new speaker of parliament, and appealed for help from the conference delegates in bringing stability.
"What we would like from you is to help us bring peace and stability to our country," he said.
Somalia has been mired in violence and lacked effective central government since the overthrow of a dictator in 1991. Islamist fighters have waged a three-year insurgency that has killed more than 21,000 people.
Ban called on the government to improve public services, start paying regular salaries to security forces and continue with efforts to build up security sector institutions.
Somalia Foreign Minister Ali Ahmed Jama told Reuters the security issue needed to be prioritised to achieve stability.
"If we take over a province or an area, we have to create life, employment, rebuild schools, hospitals and airports so that the people can say, yes we have peace. That is when we can achieve permanent stability," he said.
More than 40 percent of the population -- 3.4 million people -- require humanitarian assistance, including 1.4 million uprooted by the insurgency.
The international community, including the United Nations, has been trying to resolve and contain the crisis for the past 20 years, with more than $8 billion spent in various forms of assistance including humanitarian aid.
(Writing by Daren Butler; Editing by Dominic Evans)