A little over a year ago, I was elected president of a country that many consider the most dangerous in the world. Over the last 20 years, Somalia has been synonymous with war and displacement. Now terrorism and piracy have been added to this list – and they threaten death and destruction far beyond our borders.

Let me begin by emphasising that however bad the situation looks, Somalia is not the "failed" state of popular imagination. Somalis are resilient and committed to peace, and sickened by the nihilistic violence of the extremists who last month announced an alliance with al-Qaida to wreak havoc across east Africa.

There is nothing Somali about the violence afflicting our country. The extremists are waging war against our Somali flag, our Somali values and our religion. Witness their values: they blew up a graduation ceremony on 3 December last year, killing young Somali doctors, graduates and four government ministers. They are preventing the UN World Food Programme providing humanitarian assistance to thousands of Somalis in desperate need. It seems these extremists will stop at nothing.

They could be defeated relatively easily, however, if the international community were to adjust its thinking in two critical ways. First, it must abandon the defeatist notion that Somalia's problems are insuperable, because this becomes a self-fulfilling expectation. Second, it must rid itself of the dangerous delusion that Somalia has no relevance to the rest of the world.

The African Union Mission in Somalia is under-resourced. With the exception of Uganda and Burundi, countries have promised troops but haven't delivered. The Transitional Federal Government has trained several thousand soldiers, brave men and women ready to take on and expel al-Qaida from Somalia. The British government has done much to assist us, and we are grateful, but more support from other members of the international community is needed. If we could establish a larger, well-trained army, we could make a real difference in the fight against the extremists.

Piracy off the Somali coast is a major challenge. I am appalled that the British sailors Paul and Rachel Chandler are being held hostage. I would like to add my voice to those of the British Somali community and the elders in Somalia calling for the Chandlers' freedom. Their captivity is un-Islamic and un-Somali. We have already trained 1500 men as part of a professional Somali coastguard, but we do not have the boats and other equipment to protect Somali waters.

The TFG is committed to work with the international community to combat terrorism and promote regional security. As a result of a desire for national reconciliation, we have created a functioning coalition government made up of yesterday's enemies. We are committed to transparency, which is why we've hired PricewaterhouseCoopers to ensure the accountability of donor funds. The Central Bank of Somalia and Radio Mogadishu are now up and running. The constitution is under review. We have built bridges with our diaspora communities, foreign embassies are now operating in Mogadishu and Somalia has close to 30 diplomatic missions worldwide.

This progress is evidence that Somalia is not a "failed" state, and it is proof that something can be done. However, the extremists threaten to undo this progress, and pose danger not only to Somalia but the wider world. The international community has a duty to match the resolve of the Somali people with robust support: doing that now will be a great deal less expensive. Somalia has suffered this tragedy for decades. Let us prevent it from becoming a wider one.