Background: Otitis media (OM) is highly prevalent and is one of the most important causes of preventable hearing loss in developing countries and it may have long-term impacts on the children. Several hospital-based cross-sectional studies have been conducted in East African countries to assess the prevalence of OM; however, no similar studies have been conducted in Somalia. Therefore, we conducted a hospital-based cross-sectional study to identify the prevalence and the underlying risk factors of OM among children under the age of five in Mogadishu, Somalia. Methodology: A hospital-based crosssectional study was conducted from July 2022 to November 2022 at three main hospitals in Mogadishu, Somalia. A total of 384 children aged less than 5 years were included. Parents of these children were interviewed with a questionnaire and a clinical examination was performed for each child. The Statistical Package for Social Sciences, SPSS (Version 22, IBM, Inc.), was used for the statistical analysis. Result: The prevalence of otitis media among the 384 children recruited was 31.25% (120/384). Otitis media was significantly associated with age less than one year (P = 0.006), malnutrition (P < 0.001), upper respiratory tract infections (P < 0.001), feeding in lying position (P < 0.001), and dripping something into a child's ear (P < 0.001). The duration of breastfeeding, on the other hand, was significantly associated with an overall reduction in OM (P = 0.039). The lowest risk of developing otitis was found in children who received breast milk for more than one year. Conclusion: In summary, the present study found that otitis media was highly prevalent (31.25%) in Mogadishu, Somalia. The majority of the affected children were younger than one year.