Somali authorities have announced plans to impose a curfew on the capital, where at least five people were killed on Thursday in the latest violence to undermine government attempts to restore law.
Two policemen died when hand grenades were lobbed at officers patrolling Mogadishu's Bakara market, witnesses said.
The police opened fire in the direction of the attackers, scattering the crowds and killing at least three civilians.
"Everybody is running away. I am now closing my shop. Business has come to a standstill," shopkeeper Mohammed Abdi told Reuters.
Another trader, Ibrahim Hussein, was also going home to escape the chaos. "I saw one dead policeman while another one was lying writhing in pain. He was very seriously wounded. I don't think he will survive," he said.
Islamist fighters have waged an insurgency in Mogadishu since the New Year when their leaders who briefly controlled much of southern Somalia were ousted by the interim government and its Ethiopian allies.
Most of the residents in one of the world's most heavily armed cities now live in constant fear of being blown up in an attack by insurgents -- or shot by Somali and Ethiopian troops, whom they accuse of firing indiscriminately after bomb blasts.
Announcing the new security drive, Mohamed Warsame Darwish, head of Somali intelligence, told reporters a 7pm-5am curfew would be effective from Friday and last indefinitely.
"The curfew will continue until security improves. We decided to take this action to reduce the killings that are going on in the city." he said at police headquarters.
Restoring security in Mogadishu is the top priority of the interim government, which represents the 14th attempt to return central rule to the lawless Horn of Africa country since warlords toppled the last national president in 1991.
Some residents already struggling to make a living in the rubble-strewn, shell-shattered city feared the curfew would make it harder and do little to stem the rash of daylight attacks.
"This curfew will affect my business but if it's an order, there's nothing we can do. We have to just accept it," said retailer Faduma Aden.