Somalia's parliament on Saturday unanimously endorsed Hamza Abdi Barre as new prime minister, paving the way for the creation of a new government for the troubled Horn of Africa nation.

All 220 lawmakers present gave their blessing to Barre's appointment, and he was then sworn in to office, the parliament speaker said.

Barre 48, told parliament he would form a "quality" government that would focus on "creating inclusive political stability (in line with) the president's motto of a reconciled Somalia that is at peace with the world".

Somalia's new administration faces a raft of challenges including a looming famine and a grinding insurgency by Al-Shabaab jihadists.

The MP from the semi-autonomous state of Jubaland was chosen earlier this month by President Hassan Sheikh Mohamud, who was elected by parliament in May after a long-delayed and stormy voting process.

"Our government has an ambitious policy programme which seeks to improve our security, strengthen our economy and deliver basic services for our people," Mohamud said on Twitter after Barre was approved.

"Let us move forward together."

There are hopes that Mohamud's presidency will draw the line under a seething political crisis that blighted the rule of his predecessor Mohamed Abdullahi Mohamed and threatened to plunge the country back into violent chaos.

Mohamud himself did not appear at the parliamentary session after he said on Friday that he had tested positive for Covid-19.

"So far, I have no symptoms but I will continue to self-isolate and serve the people of Somalia from home," he said on Twitter after returning from the United Arab Emirates where he had made his first official trip abroad since his election on May 15.

Mohamud is a former academic and peace activist who was previously president from 2012 to 2017 but whose first administration was dogged by claims of corruption and infighting.