In this file photo taken on February 13, 2022 People wait for water with containers at a camp, one of the 500 camps for internally displaced persons (IDPs) in town, in Baidoa, Somalia. AFP
The ceremony was held in the capital's heavily fortified Halane military camp, protected by sandbagged fences and high concrete walls. Somali police and African Union troops were deployed to the surrounding areas, putting Mogadishu under lockdown.
Dozens more legislators are yet to be selected and sworn in.
Later the lawmakers will elect speakers and deputies for both parliamentary chambers before they sit to choose a new president.
``We are observing a new set of parliamentarians taking over from others. I want to take this opportunity to congratulate parliamentarians who have been sworn in today. This is a huge responsibility assigned on you by your constituents, and it is a vote of confidence,'' said Prime Minister Mohamed Hussein Roble.
The swearing-in took place as the U.N. humanitarian coordinator in Somalia warned that ``the country is facing a very real risk of famine.''
Adam Abdelmoula said in a video briefing for U.N. reporters in New York that severe drought has compounded humanitarian needs, and 6 million people ``need food assistance immediately.''
The U.N. asked for $1.5 billion to meet humanitarian needs in Somalia in 2022, but he said that ``we have received just 4.4%.''
Hussein Sheikh Ali of the Mogadishu-based research group Hiraal Institute said the inauguration of lawmakers ``marks a great relief day for all Somalis and (the) international community who invested in Somalia to move forward.''
Only in the past few years has Somalia begun to find its footing after three decades of chaos from warlords to the al-Qaida-linked al-Shabab extremist group and the emergence of Islamic State-linked extremist groups.
Somalia's parliamentary and presidential polls were delayed for more than a year amid political turmoil after President Mohamed Abdullahi Mohamed's mandate expired in February 2021 without a successor in place. Lower house elections that were to be completed on March 15 are still not complete.
The delay raised political tensions and the threat of violence in a country prone to attacks by Islamic extremists who oppose the federal government.
Al-Shabaab claimed to have thrown mortar shells targeting the area where the lawmakers were being sworn in on Thursday. Authorities didn't say if anyone was hurt.
Abdelmoula, the U.N. humanitarian and resident coordinator, stressed the importance of tackling the drought and famine threat, and urged donors to respond quickly.
He said he visited a camp for internally displaced people in Dolo in southwestern Somalia near the border with Ethiopia on Wednesday with other U.N. officials and ``we were taken aback and also shocked by the conditions we have found many people in.''
At a nearby clinic, he said, ``we saw malnourished children with their equally malnourished mothers'' as well as 400 newly arrived displaced people seeking food, water and shelter.
``Any dollar spent right now will help save more lives now,'' Abdelmoula said.