By Roger Middleton
Ethiopia entered Somalia two years ago to remove the Union of Islamic Courts , elements of whose leadership had been making provocative and aggressive statements about Ethiopia.
But the reality is that Ethiopian intervention, backed by the US and others, seems to have bolstered precisely the elements of the UIC, al-Shabab, that are most at odds with Ethiopia's interests and may very well have fatally undermined any chance Somalia's Transitional Federal Government (TFG) had of gaining legitimacy.
Ethiopia has announced that they will leave Somalia, come what may, by the end of the year.
This announcement follows warnings to Somalia's government from its major backer to get its act together.
Ethiopian troops helped install the internationally recognised government in Mogadishu last year and without Ethiopian support ministers would still at best be holed up in Baidoa or more likely comfortably in the hotels of Nairobi.
But without popular support or local legitimacy the government has singularly failed to establish itself, as even President Abdullahi Yusuf appears to be admitting.
Consequently, in most of Somalia, the TFG is a government in name only.
Some see Ethiopia's threat to leave as a bluff to elicit funds from western countries afraid of al-Shabab entrenching itself in southern Somalia.
Al-Shabab, which is on the US list of terrorist organisations and has taken control of Kismayo, Merca and large parts of southern Somalia, grew from the Union of Islamic Courts but now stands against some other former UIC members in the Djibouti-based Alliance for the Reliberation of Somalia (ARS) opposition who are negotiating for Ethiopian withdrawal.
Al-Shabab is not a monolithic organisation but within it there are elements who represent a very hard-line tendency who were responsible for the stoning to death of a 13-year-old girl accused of adultery, who had in fact been raped.
Stories are also circulating of beheadings and Somalis speak in hushed tones of their fear of what an al-Shabab dominated country would be like.
This future is not what was promised when the UIC were ousted and looking back, many residents view the time of UIC rule as a golden age.
International concerns about links between the UIC and international terror networks were never substantiated and al-Shabab is far more likely to cultivate those connections.
Another view holds that Ethiopia is quite serious about leaving.
Somalia is a hardship posting for Ethiopian troops and the continuing mission may be affecting morale.
Al-Shabab is even able to put on shows of force in Mogadishu
Ethiopia also has a more serious security concern along the still un-demarcated border with Eritrea.
Many see this as the real threat to Ethiopia's security. Although the total number of troops in Somalia is small as a proportion of Ethiopia's army, the resources required to maintain them in Mogadishu could be better used along the border.
Ethiopia may also feel that leaving Somalia is the only way to force the government to work together to make the Djibouti peace process work.
In any case, at present, Ethiopia is bogged down fighting an insurgency that gains strength from their continued presence and the government they came to protect and bolster has shown no sign of becoming effective or being able to handle its own security.
The more moderate elements of the various opposition forces are being undermined and al-Shabab is growing in military and territorial strength.
For Ethiopia the objectives they hoped to achieve in Somalia seem very hard to attain whether they stay or go.
Leaving at least means Ethiopian troops will not remain trapped in the ongoing chaos.
If Ethiopia leaves Somalia now, it is likely that the TFG will finally cease to exist.
The broad coalition that makes up the ARS could very well break into its constituent parts and start fighting each other, as well as the militias of former TFG bigwigs and the extremist al-Shabab groups.
Best of a bad situation
One strand of opinion holds that the only thing that keeps the various factions of the ARS, the government, or indeed al-Shabab, united is the presence of Ethiopian troops inside Somalia.
It is feared that a power vacuum will arise after the Ethiopians pull-out
Yet, the departure of Ethiopian troops is one of the few concrete things that the UN-brokered negotiations between the ARS and government have been able to agree on.
It is depressingly possible that whilst almost all Somali factions are agreed on the need for Ethiopia to leave, the lack of forward-thinking will mean that after the troops are gone, violence will intensify as multiple groups fight for their share.
So will Ethiopia leave?
This will likely mean that the government they backed and the president, that it is often alleged Ethiopia chose, will fall.
Or do they stay - leaving a government that has yet to gain legitimacy to deal with the growth of al-Shabab.
The calculation in Addis Ababa seems to be that it is time to make the best of a bad situation and get out.