The instructor's whistle tweets, and around 50 Somalis drawing paychecks from the U.S. government punch the air in front of them with varying degrees of coordination and enthusiasm.
The men, destined to be part of the Somali government's VIP protection team, are practicing karate at a newly built parade ground in the capital. Instructors say the lessons are less about self-defense and more about trying to mold a collection of ragtag militias into a national army _ a problem advisers have also faced in Afghanistan.
"Whoever has picked a gun and a rag of a uniform out here is called a soldier. But they don't have the basis of what it takes to be a professional," said Capt. Frank Kaweru, the African Union's chief instructor at the al-Jazira Somali military base. "Discipline is the most important thing for them to learn. I insist on it."
In recent weeks Somali forces have shot civilians, each other, and looted food aid meant for famine-hit families. Yet these are the forces many aid agencies must rely on to protect vast amounts of food pouring into Somalia. They are also supposed to help the 9,000-strong African Union force secure the country's capital after Islamist rebels withdrew from bases there this month.
But many now fear that with the Islamists gone, Somalia's armed forces _ still organized largely along clan lines _ may simply fight each other and try to extort money from the civilians they are meant to protect.
"A real danger exists that the warlords and their militia groups will move forward to fill the vacuum created by al-Shabab's departure," said Augustine Mahiga, the U.N.'s special envoy to Somalia, after al-Shabab pulled out.
Still, Somalia's armed forces _ 10,000 soldiers, 5,000 police and assorted allied militias _ have seen some improvements over the past year. Since December, the soldiers have been receiving a regular $100 paycheck every month from the Italian and American governments. The police receive the same amount through the U.N.
International accounting firm PriceWaterhouseCoopers and the AU force administer the army payments, handing each man his cash in person to prevent theft by commanders.
The soldiers have also received new uniforms. Al-Jazira has been transformed from a wasteland dotted with a few ragged tents and no fence to a fortified camp with guard towers, razor wire, classrooms and a school. Vast white tents can house over a thousand trainees at a time. Before, they often slept under trees and those who weren't paid sometimes sold their weapons and bullets to feed their families.
Last year the European Union began training 2,000 Somali soldiers for six months at a time in Uganda. The U.S. helped by funding transportation for trainees to and from Somalia, paying for equipment and salaries for the soldiers, and supporting the Ugandan army.
EU adviser Patrick Geysen said the first phase of training had been completed for nearly 2,000 men. The program has been extended, he said, and another batch of 500 Somalis will begin training in October, focusing on midlevel and junior officers.
AU officers also say they are working more closely with the Somali army than they used to. AU front-line units were seen sharing equipment and sleeping quarters with Somali soldiers, something unthinkable only a year ago when there was deep distrust between the forces.
"We are fighting shoulder to shoulder with our brothers," Somali Lt. Mahad Abdullahi Mohamud said proudly.
But most Somali soldiers are loyal to individuals, not to the weak U.N.-backed Somali government, and most brigades are still organized along clan lines. Analysts say unless the government _ widely perceived as divided and corrupt _ must improve its performance and command loyalty.
The soldiers at Camp al-Jazira say all they can do is try to break some of the habits picked up over 20 years of civil war. As he watched a platoon of soldiers go by, struggling to march in step, instructor Kaweru said he knows there is still a long, long way to go.
"At least we have started something," he said. "We need to hand over Somalia to a professionalized army. We will not stay here forever."