The country’s Ministry of Agriculture said the insects, which consume large amounts of vegetation, posed “a major threat to Somalia’s fragile food security situation”.
There are fears that the situation may not be brought under control before the harvest begins in April.
The UN says the swarms are the largest in Somalia and Ethiopia in 25 years.
Meanwhile, according to the UN Food and Agriculture organization, neighbouring Kenya is also witnessing the worst locust threat of the last 70 years. However, Somalia is the first country in the region to declare an emergency over the infestation.
Earlier, Uganda was on high alert after swarms of locusts spread across East Africa.
The government has announced it is ready to handle the threat, after an infestation was reported in neighboring Kenya.
The Ministry said the wider spread of Desert Locusts in Kenya puts Uganda at a high risk of invasion by the end of this month.
The head in charge of agriculture said the country is working with the Desert Locust Control Organization for Eastern Africa and other development partners to contain the spread.