According to the country's Health Ministry, the officials contracted the virus from a patient in the capital Mogadishu. Dr Ibraahim Guled, the secretary general of Somali Medical Association, is among the infected.
Somalia confirmed its first COVID-19 case in mid-March. Since then, a total of 80 people have been diagnosed with the disease. Five people have also died, along with two regaining health.
The African nation, in order to contain the pandemic, imposed a night curfew in Mogadishu from Wednesday. Schools and universities, meanwhile, are already closed.
Hospitals, pharmacies and food stores are not subject to the restrictions, as per Somali police chief Abdi Hassan Mohamed Hijar.
The virus, which was first detected in Wuhan, China late last year, has spread to 185 countries. It has killed more than 137,000 people and infected over two million.