"It is very unfortunate that an army under the command of the former president attacked my residence," Mohamud said, referring to Mohamed as "the former president".
"I have already warned (about) and reiterated the dangers of politicizing security. Farmajo is responsible for the consequences," he said, referring to Mohamed by his nickname.
A government spokesman did not immediately respond to a request for comment on the accusations from Mohamud, who was replaced as head of state by Mohamed in 2017.
But the internal security minister, Hassan Hundubey, denied that the government had raided the former president's home, according to the state-run Somali National News Agency.
Hundubey said of Sunday's fighting in Mogadishu that government troops had subdued militia. He did not say who the militia were allied with.
"After efforts of trying to find a solution through negotiations failed, the security forces intervened and concluded the operation against the militia," Hundubey said in a Facebook broadcast.