By Amber Henshaw
BBC News, Addis Ababa
The dramatic turn-around in Somalia within the last two weeks caught everyone on the hop - journalists, analysts, even perhaps the soldiers.
The Somali army is backed by Ethiopian heavy weaponry
Ten days ago, the Union of Islamic Courts was in control of the capital Mogadishu and large parts of the south.
The transitional government was on its back foot. But, just days later, the situation is pretty much reversed.
Things have been moving so fast that people have had little time to consider the really big question - what next?
Return to power vacuum
Here is the current situation: reports from Somalia suggest that government forces, backed by Ethiopian troops, have captured the Islamists' last stronghold of Kismayo.
Islamist leaders say they have retreated for tactical reasons, and because they wanted to avoid further bloodshed.
The worst case scenario for the future is that the situation could end up mirroring Afghanistan or Iraq: a quick defeat followed by protracted fighting from insurgents.
Diplomats in Addis Ababa believe this is a real possibility.
They say what happens next will depend on what the transitional government does.
The Union of Islamic Courts stoked these concerns yesterday by warning they will start an insurgency.
The head of the Islamic movement in the Kismayo region said, "Even if we are defeated we will start an insurgency.
"We will kill every Somali that supports the government and Ethiopians."
Before the Union of Islamic Courts took charge there was a power vacuum in Somalia.
Until June, warlords controlled Mogadishu which was lawless and dangerous.
The transitional government was isolated in the southern town of Baidoa where it has its headquarters.
Matt Bryden, an expert on Somalia, said the courts expanded into a vacuum left by the transitional government's failure to govern.
He says the transitional government is not popular with the residents of Mogadishu.
"So now we are here. The courts have been beaten but it is still the same old transitional government and the vacuum has been reinforced by the collapse of the Union of Islamic Courts."
He said it was unlikely that the transitional government would be able to fill that vacuum without the help of powerful clan leaders.
Many believe the government now needs to include the clan leaders and the remnants of the Union of Islamic Courts to prevent the power vacuum opening up again.
Some believe this would pave the way for an insurgency.
There is no way the transitional government would be in the position it is today without Ethiopia's military help.
But what about the Ethiopians' role now? Ethiopian Prime Minister Meles Zenawi has made it clear throughout that he wants his troops out of Somalia as quickly as possible.
He says that Ethiopia is not in a position to help reconstruct its neighbour, although the threat of insurgency could mean he has to leave his troops across the border to help keep peace for longer than he originally wanted.
It seems, in this case, Ethiopia just wanted to protect its self-interest when it came to involvement in Somalia.
It was clearly nervous about the rise of the Islamists, fearing that extremists could create problems in the whole of the Horn of Africa.
Ethiopia's population is almost equally split between Orthodox Christians and Muslims who, in the main, live harmoniously side-by-side.
There were fears that this balance could be destroyed and problems could flare.
Three months ago, religious violence erupted in a town called Jimma west of Addis Ababa.
More than 15 people were killed. Some believed the problems started when religious extremists stirred up tensions in this predominantly Muslim area.
Addis Ababa's involvement may have increased the likelihood of terrorist attacks on Ethiopian soil but, in the end, Mr Zenawi must have decided that doing nothing was not an option.
The international community was certainly sceptical about Ethiopia sending troops across the border.
There are many risks and problems facing Somalia now, even though the Union of Islamic Courts have been beaten back.
The future, it seems, depends on how the victors play their cards and what the international community can offer to help rebuild this vulnerable nation.