(Adds details, background, byline)
By Hassan Yare
BAIDOA, Somalia, Feb 7 (Reuters) - Somali Prime Minister Ali Mohamed Gedi reshuffled his cabinet on Wednesday, stamping his authority on a government seeking to reassert itself in the chaotic nation after driving out rival Islamists.
Gedi, whose divided government almost collapsed last year in the face of an Islamist advance, sacked three ministers and brought in unknown faces to try to meet the clan power-sharing formula prescribed for it when it was formed in 2004.
The reshuffle precedes a national reconciliation conference aimed at appealing to all sectors of Somali society after Somali government forces and their Ethiopian allies ousted the Islamists from their southern strongholds in a two-week offensive that began in late December.
They have been pursing the Islamists in remote parts of south Somalia since and the government blames Islamist remnants for a wave of guerrilla-style attacks in Mogadishu on both government and Ethiopian positions.
In the latest such strikes on Tuesday, a mortar flew into an open space near the presidential palace, while assailants targeted a Mogadishu hotel with rocket-propelled grenades.
"After weighing the hard times the country is facing and seeing the need to reshuffle some of the ministries, I’ve decided to sack others, and nominate new cabinet ministers," Gedi said in a statement.
A government statement said Health Minister Abdiaziz Sheikh Yusuf, Higher Education and Culture Minister Hussein Mohamud Sheikh Hussein had been sacked after "they had failed to carry out their duties and were involved in misappropriating funds".
Mineral and Water Resources Minister Mohamud Salad Nuur was fired for failing to be sworn in after he was appointed.
The cabinet reshuffle involved 10 changes, including moving Interior Minister Hussein Mohamed Farah Aideed to the public works portfolio although he remains deputy prime minister.
Gedi swapped the portfolio of another deputy premier Salim Aliyow Ibrow who was minister of livestock. Ibrow, who was a contender in the vote for a new parliamentary speaker last week, now becomes minister for higher education.
Gedi found himself clinging to power in August when he struggled to keep his cabinet intact amid a flurry of resignations by ministers and their assistants who accused him of blocking reconciliation efforts with the Islamists.
Somali President Abdullahi Yusuf was forced to dissolve the 42-member cabinet which was crippled by infighting and Gedi later named a slimmer 31-member cabinet in an effort to rejuvenate his fragile government.
Gedi’s position was threatened when the Islamists effectively flanked the Baidoa-based government on three sides.
The government still faces a huge challenge in trying to tame the country deprived of effective central rule since the 1991 ouster of a dictator.