The sea breeze carries the sound of Mogadishu's dawn chorus of munitions as far as the sand dunes high above the Indian Ocean. On the horizon, the grey hull of a foreign warship patrols for pirates; inland, mortars thud out from the African Union (AU) positions around the old harbour and volleys of automatic fire reply from the direction of al-Shabaab's stronghold at the notorious Bakara Market. The exchanges are interspersed with the sharp crack of sniper fire.
In a seemingly endless war, the battle for the shattered Somali capital has reached another turning point. In among the warren of ruined buildings the African peacekeepers, sent here to protect Somalia's weak UN-backed government from the onslaught of Islamic extremist militias, are inching forward.
The frontline is reached through a series of skeletal hotels, once grand seaside residences where soldiers' tents are now pitched in bare concrete shells. The battle is being fought "building by building" according to Lt-Col Francis Chemo, a commander with the Ugandan contingent, and the opposing lines are only "metres apart".
The narrow coastal strip from the airport to the seaport and the presidential palace at Villa Somalia that has been the sole territory under the control of the transitional federal government (TFG) is expanding. But the effort to wrest the city from the control of al-Shabaab fighters has been fatally undermined by the theft of international donor money meant to pay for Somalia's own army.
Where the fighting is most intense north of the bombed out Jubba Hotel the AU forces give way and a ragged-trousered Somali army starts to appear. This is the government force – trumpeted by the international community – that is meant to overcome al-Shabaab.
While hundreds of millions of pounds in military aid has been pledged to prevent a al-Shabaab takeover of the Horn of Africa nation, an unpaid army of government forces is fighting, dying and defecting in Mogadishu.
In a bid to prop up the government of President Sheikh Sharif Sheik Ahmed, the EU is training 1,000 Somali fighters in Uganda and the US has donated 40 tons of weaponry. However, Western diplomats complain that much of this has gone straight over to the extremists due to the ineffective and corrupt TFG.
Abdi Rahman is typical of the frontline soldiers in the war against al-Shabaab. Twenty-one years old, with only half a uniform, he hasn't been paid in the six months since returning from training in Uganda. He says he joined to "fight the terrorists," but needs money to survive.
Ahmed Hussein Hilolwe, 24, a government soldier who was hit in the leg in heavy fighting with al-Shabaab last month, says that it is four months since he was last paid. Many of his colleagues can't wait, he says, so "they sell their weapons" or defect to al-Shabaab.
Ahmed Mohamed Turyeye joined the government forces two years ago and says that he is already owed15-months' wages. "Some of us are joining the opposition," hesaid. "The money we are getting is not enough to fight a war."
A UN official with 15 years experience in Somalia confirmed that an account containing $8million is on standby waiting for the government in Mogadishu to provide an accurate list of names. Without that payroll, no more money will be released. Somali's new prime minister Mohamed Abdullahi Mohamed admitted that past administrations had taken the money for themselves. "Soldiers haven't been paid because of corruption and mismanagement," he told The Independent.
In the past two years, millions of dollars in military aid has been siphoned off in payments to so-called "ghost soldiers" – fake names on government rolls – while the real army remains largely penniless. With its own security forces in disarray an AU force made up of Ugandan and Burundian troops has acted as a last line of defence for the TFG against Islamic militias who have long held most of the capital.
The AU force has risen to 8,000 troops this month with a further 4,000 expected by March next year, according to Western diplomats in the Kenyan capital, Nairobi. A Ramadan offensive by al-Shabaab failed to gain ground and may have fatally weakened the militia, which is riven by its own internal divisions.
AU spokesman, Major Barigye Bahoku, insists that more than half the territory of the city and 80 per cent of the population is currently under government control and that the tide has turned. Privately, ministers admit that the TFG are present in only eight of Mogadishu's 18 districts and population numbers are impossible to estimate in a war zone.
Yesterday, Ugandan President Yoweri Museveni became the first head of state to visit Somalia in 20 years and used the occasion to appeal for US funds to expand that force to 20,000 troops. He questioned the international focus on protecting shipping off the Somali coast and said the money would be better spent on land.
"The international community don't take the Somali problem seriously, they're in the ocean having a nice time," he complained. Ugandan and Burundian commanders on the ground insist that with more troops they could "capture and hold" larger sections of the city. Urban warfare in Mogadishu is played out against an almost unimaginable landscape of destruction.
The al-Shabaab try to match the superior firepower of the AU forces with a battery of suicide bombers, snipers, mortar fire, roadside bombs and improvised explosive devices (IEDs).
"They have their tactics," says Ugandan commander, Lt-Col Chemo. "And they don't care if they die."
His forces are camped in the ruins of old villas and apartment blocks built when this was still an Italian colony. The few remaining walls in these shattered buildings offer a glimpse of the lives of al-Shabaab fighters that held them only weeks ago. Crude graffiti litters the stairwells with naked women and assault rifles drawn among vertical lines of Islamic slogans.
A warning notice has been posted in red ink on the wall, it reads: "If you get a call from these numbers don't pick up!" A Ugandan officer explains that a soldier reportedly died at the port after receiving a call from an al-Shabaab operative using a mysterious audio weapon. Others dismiss it as nonsense. But the fear of an unseen enemy has given rise to bizarre rumours among the soldiers.
The toll on the city's civilian population has been even more immense. According to figures from the Mogadishu ambulance service, 2,170 civilians have died this year in the fighting. Ali Muse, the head of the independent ambulance service, denied reports that he had blamed the bulk of these deaths on the African Union Mission for Somalia (Amisom) forces shelling residential neighbourhoods, but there is mounting concern that the African peacekeepers are losing the battle for Somali hearts and minds.
"Civilians live in Amisom and government areas as well as rebel areas, so residents die in the exchange of shells," said Muse. "I cannot know the percentage but what I know is that the exchange of shells kill civilians in all places."
Last Tuesday the AU force issued its first ever public apology after two civilians were killed and six more wounded after soldiers "unintentionally" opened fire on passers-by.
Libaan Dahir Hassan was one of the victims. A seven-year-old boy, he has a piece of shrapnel lodged in his spine and was being operated on yesterday by Ugandan doctors at the Amisom base hospital.
Schoolteacher Abdullahi Amin had to have his leg amputated after being hit in the same incident. He said the AU soldiers were in a convoy in a peaceful area when they suddenly opened fire on civilians for no reason.
Abdulkarim Ali Hersi, in the bed across from him, who had his leg shattered by a bullet while walking home from school, said: "The Amisom troops were just firing on all sides."
Abdulaziz Abdullahi Nur, whose wife was also wounded, said it was not an isolated incident and said he counted dozens of artillery shells being fired "morning, afternoon and night" from Amisom positions into civilians areas. Six peacekeepers have been suspended pending an AU investigation into the incident.
AU officials have denied targeting civilians or firing into residential neighbourhoods and insist this is al-Shabaab propaganda. Those who can't leave move from one area to the next seeking shelter. Every day reports of executions, mutilations and rape trickle out of al-Shabaab-controlled areas.
There is certainly no shortage of recruits for the new Somali army. At the Jazira camp, ranks of weaponless volunteers are yelled at and beaten with canes as they attempt marching drills in the scalding sun. Dozens more recruits wait to sign up nearby, many of them barely teenagers. When Fadima Hassan Ismail reaches the registrar he gives his birth date as 1992. The AU soldiers laugh and point at his boyish face, but he is signed up anyway. An older man shrugs and says the boy is actually 13. "But his parents were killed by al-Shabaab. He wants to fight."
Background to failure
Somalia is the world's most failed state. A near constant civil war has raged across its southern and central regions for two decades.
At sea this lawlessness has been felt internationally thanks to a surge in piracy. On land there has been no central administration since 1991.
While a UN-recognised transitional government remained in exile, power passed from warlords to a brief period of relative stability under the leadership of the Islamic Courts Union in 2006. That experiment was ended by a US-backed invasion force from neighbouring Ethiopia, which feared the creation of a hardline Islamic regime on its doorstep.
Ethiopia's presence in the country united warring factions against the occupation and spurred the creation of extremist militias – the most powerful of which was al-Shabaab.
Since Ethiopia withdrew its forces, the international community has turned in desperation to Sheikh Sharif Sheikh Ahmed, the same leader of the Islamic Courts they had removed by force.
Calling him a "visionary" and a "moderate", they helped to put him in charge of the transitional federal government which returned to Mogadishu. But a promised grand offensive against al-Shabaab quickly stalled.
Tales from Mogadishu
Anna Diriya, 20
Among the marching lines of new recruits at Mogadishu's Jazira training base was a skinny girl drilling with the young men. "My uncle and my brother were both killed by al-Shabaab," and she could fight them "just like the men". She has joined about 1,000 recruits, many of whom will be sent for EU-funded military training in Uganda.
Abdi Rahman, 21
Dressed in a fake designer T-shirt and high-heeled sandals, the young soldier's teeth are stained green from chewing the stimulant khat. He
was trained in Uganda but has not been paid since coming back to Somalia six months ago. He has not defected to the al-Shabaab because they are "terrorists". Hundreds of other young men have swapped sides, though.
Saida Sheikh Mahmoud, 37
An unemployed nurse living in an IDP camp, she had to flee her home to escape al-Shabaab. "When they see you coming from a government area, they say you are a spy and they can kill you," she says. "If the people were given guns, they would rise up against al-Shabaab. They have pushed us against the wall like the warlords did before them."