Ali Mohamed Gedi, the prime minister, said in late December that three months of a state of emergency were necessary to impose order after Ethiopian troops, planes and tanks helped Somali government forces end six months of rule by the Islamic courts.
The government is seeking to install itself in the capital Mogadishu and faces a huge challenge to bring peace and security to the country.
Mohammed Adow, Al Jazeera's Somalia correspondent, says the imposition of martial law is designed to disarm many civilians and restore some law and order after 16 years of largely anarchy.
He says the state of emergency gives powers to the country's president to issue decrees and ban public demonstrations.
"Peace is possible if the interests of US and the Ethiopians are removed"
Ahmed, Bossaso, Somalia
Send us your views
The declaration of a state of emergency comes as many African countries drag their heels over committing troops to a proposed peacekeeping force for the country.
South Africa is among those delaying after initially making promising noises about committing troops.
The African Union wants up to 8,000 troops in Somalia but so far Uganda, who will send 1,000 troops, is the biggest contributor.
Kalay Maistry, Al Jazeera's southern Africa correspondent, says foreign affairs sources have told her that since the US strikes in Somalia this week, some South African officials are concerned that if they participate in the peacekeeping force it may look like they are willing participants in America's "war on terror".
On the other hand, Hussein Farah Aideed, the Somali deputy prime minister, interviewed on Al Jazeera, said he does not have information about the presence of US soldiers in Somalia or the killing of civilians in the recent US air raid in the southern part of the country.
Aideed also said the pros of the military operations far outweigh their cons.
He said the US intervention in his country was justified and based on a mandate granted by the Somali government.
"The problem is not the US but the al-Qaeda network, because the US is just protecting its citizens by preventing al-Qaeda elements from escaping from Somalia."
Meanwhile, Somali government and Ethiopian forces have reinforced their stranglehold over southern Somalia by capturing a village purportedly being used as a refuge by fighters of the Islamic courts forced to flee into forests.
Many Islamic courts fighters were believed to be holed up in the coastal village of Ras Kamboni near the Kenyan border.
They were forced to flee south by advancing government forces backed by Ethiopian troops, planes and tanks in an offensive launched in December.
Abdirahman Dinari, a spokesman for the Somali government, said the troops "will not stop the chase until we are sure they are totally eliminated".