Fighting broke out earlier in the day after opponents of incumbent leader Mohamed Abdullahi Mohamed, also known as Farmaajo, captured areas close to the ex-president's home.
"It is very unfortunate that an army loyal to the former president attacked my residence. I have already warned about the dangers of politicising security. Farmaajo is responsible for the consequences", he tweeted.
Farmaajo drew condemnation at home and abroad after he signed an extension of his mandate into law last week. His four-year term expired in February, but a new vote never took place.
The Horn of Africa nation has been torn by a civil war that broke out after militants deposed its long-time dictator Siad Barre in 1991. The Mogadishu-based government has been struggling to hold off armed groups, who control much of central and southern Somalia.