The Somali government says militiamen have attacked army positions in the capital, Mogadishu, close to the Presidential Palace.
In a short statement, the country’s security minister said the attack had been repelled.
Residents reported hearing the sound of heavy gunfire.
It came hours before Somali opposition parties plan to hold a protest against President Mohamed Abdullahi Farmajo remaining in office.
His term expired last week, without the selection of a successor, throwing Somalia into a political crisis.
President Farmajo is expected to hold a meeting with Somalia’s five regional presidents as part of efforts to end the deadlock.
Meanwhile, heavy gunfire has been reported in Somali capital, Mogadishu, as a group of opposition leaders defied a government ban on public gatherings and held protests.
Security forces have closed most roads in the city over the planned protests.
The opposition parties want President Mohamed Abdullahi Farmajo to leave office after his term ended last week, without the election of a successor.
BBC reports that there has been heavy gunfire in several parts of the city.
Opposition presidential candidate, Abdirahman Abdishaku, was among those who tried to lead a march.
Security forces shot in the air to disperse some protesters.