"Increased military-style tactical training, massive popular support and the strength of commitment of ideological motivation, as opposed to mercenary motivation, means the Islamists were motivated to continue in the face of adversity," said a former military official on Wednesday, asking to remain anonymous.
Mogadishu fell into the hands to the Islamic Courts Union (ICU) militia on Monday after several months of fighting.
The Islamists, who fought an alliance of warlords said have been funded by the United States as part of its "war on terror", were also getting external assistance, according to a UN report.
The militia transformed the face of warfare on Mogadishu's streets, shifting away from the traditional haphazard, frenzied attacks made famous by the book and film Black Hawk Down - the story of the killing on 18 US troops in Mogadishu in 1993.
"Increased military-style tactical training, massive popular support and the strength of commitment of ideological motivation, as opposed to mercenary motivation, means the Islamists were motivated to continue in the face of adversity"
A former military official
On several occasions, the Islamic side carried out night commando raids, attacked before dawn or fought through the night - all rare tactics in Somalia, residents and observers said.
"If you've got military leaders, you can do that. The warlords are living in medieval times," said a Western diplomat who follows Somalia.
The improved tactics may be explained by the presence of former military men in the top ranks of the Islamist side.
Chief among them is Sheikh Hassan Dahir Aweys, a former army colonel decorated for bravery during war with Ethiopia in 1977.
A UN report last month on violations of a 1992 Security Council arms embargo on Somalia said Aweys had set up military training programmes for his militia since early last year.
The report also said Eritrea and Ethiopia shipped weapons to Somalia. Eritrea denied this but Ethiopia did not respond.
The two countries have staged their own proxy war in neighbouring Somalia, with Eritrea supporting the Islamists and Ethipia co-operating with Washington in backing the warlords.
The warlords, who had divided the capital into rival fiefdoms with their private armies since toppling the former president, Mohammed Siad Barre, in 1991, are largely despised by ordinary citizens, analysts say.
In contrast, the Islamic courts were popular for restoring a semblance of order to parts of Mogadishu.
The Islamic side was also credited with taking more care to avoid killing civilians, many of whom were hit by stray warlord mortar shells, residents said.
About 350 people, mostly civilians, have been killed in street battles since February between the Islamist militia and the so-called Alliance for the Restoration of Peace and Counter-Terrorism (ARPCT).
Islamist militiamen took care to
avoid killing civilians
"I think they [Islamists] were a bit more restrained in that respect and the result of that was an overwhelming popular support," the military expert said.
Somalis and analysts say wealthy Islamic businessmen in the country provided most of the money for the militia, although diplomats suspect that Somalis in the diaspora and foreign Arab businessmen have provided money as well.
A protege of Aweys, Aden Hashi Ayro, was trained in Afghanistan - many suspect by al-Qaeda, though the Islamic militia denies any links to the group.
The ARPCT said it was fighting to remove those elements from Somalia, some say in a cynical ploy to win US funding.
As result, many Somalis saw them as a puppet of the United States and its "war on terror", often seen by Muslims as an assault on Islam.
Fuad Ahmed, an Islamist militiaman, told Reuters by phone from Mogadishu: "I think we won because most of our fighters were fighting for the sake of Allah. They fought knowing they are defending Islam."
The religious militiamen have said their next step will be to establish an Islamic state in Somalia. The recently installed interim government has no real power or control over the country.