Deployed in one of the world's most dangerous conflicts, Somali soldiers risking their lives daily against Al-Shabaab insurgents were growing weary of being paid months late and shortchanged by their superiors.
"We never received the complete amount," a captain told AFP on condition of anonymity, grumbling about "middlemen" who syphon off troops' meagre wages -- some as low as $100 a month -- and plunder budgets meant for weapons, rations and uniforms.
Then in March, his pay arrived on time, in full and straight to his bank account, in what officials say is the first step in a radical shake-up of its graft-ridden armed forces.
The government, under pressure from foreign backers, has started paying troops directly, bypassing army commanders previously tasked with disbursing their pay but diverting the money instead.
Under the new system, payments are linked to a biometric database containing soldiers' fingerprints, personal details and bank accounts, replacing patchy records kept on Excel spreadsheets.
Officials say about 10,000 "ghost soldiers" were expunged from the records -- roughly one in three troops according to government estimates, though analysts questioned these figures.
These fictitious troops either did not exist at all or had long ago deserted.
By taking control of salary payments, Mogadishu is seeking to cut out powerful commanders who for decades ran the Somali National Army (SNA) "as private fiefdoms," Fiona Blyth from the UN Assistance Mission in Somalia wrote in an April report.
The shake-up was fiercely resisted in some quarters of the army, with several soldiers deserting their barracks in March in protest.
A game changer?
But the government is pressing ahead. In July it also began registering fighters from an allied militia into its security forces, and identifying older or injured soldiers for retirement.
Mogadishu says the reforms are a milestone in decade-long efforts to rebuild the army into a force capable of taking over when the roughly 20,000 African Union AMISOM peacekeepers leave.
"We are not there yet. A lot of things need to be done first... but ultimately I think it will be a game changer," a government adviser told AFP.
African soldiers were deployed in 2007 to provide muscle until Somalia's army could stand on its own. AMISOM's withdrawal is slated for 2021.
Somalia's donors have long complained that there is little to show for the hundreds of millions poured into rebuilding the SNA.
In 2017, after a decade of international money and support, an internal review concluded the army was a "fragile force with extremely weak command and control and military capabilities".
Many units lacked weapons, basic medical supplies and even uniforms.
That same year, the United States suspended aid for the SNA over fraud concerns.
But recent efforts to boost accountability and professionalism in the military have struck a chord with traditional allies.
The United States announced this month it was resuming limited, non-lethal assistance to an army unit in Lower Shabelle, where SNA and AMISOM troops liberated key towns from Al-Shabaab in April and May.
"The US notes several Somali-led steps towards security sector reform over the last year, notably the biometric registration", a State Department official told AFP.
Mohamed Ali Hagaa, a cabinet minister and top defence official, told AFP this "clearly demonstrates increased confidence in the security sector".
Army in name only
Analysts say the reforms, though important, gloss over a sobering reality: the SNA is nowhere near ready to secure a nation mired in civil war, clan violence and jihadists still controlling swathes of countryside.
"It's really an army in name only," said Matt Bryden, director of Nairobi-based think tank Sahan.
"Just because an individual has been biometrically registered and is on some payroll list, doesn't mean that they are actually a trained soldier in a formed unit."
The SNA faces a formidable foe in Al-Shabaab, which this month alone bombed the Mogadishu mayor's office, blew up a checkpoint near Somalia's international airport and stormed a hotel with gunmen, collectively killing 49 people.
In January, heavily-armed jihadists overran a military camp on the outskirts of Kismayo, killing at least eight soldiers in one of their frequent ambushes of SNA locations.
Efforts by Somalia's international partners to ready the SNA for war have been criticised as being uncoordinated and piecemeal.
Some are trained by the British, others by the EU or the Turkish. Until 2018, the United Arab Emirates drilled its own troops in Somalia while the US, which focuses on drone strikes and Somalia's special forces, mentors another unit.
Encouraging these myriad stakeholders -- all with their own strategic ambitions in the Horn of Africa nation -- to work together has been difficult, say analysts.
Until this happens, the SNA would be "highly uneven in their effectiveness," said Paul D. Williams, associate professor at the Elliott School of International Affairs at George Washington University.
"Ideally, greater coherence would come from fewer partners directly training and mentoring the SNA. But no single country has proved willing to offer the entire package," he said.