The re-instatement was followed by an emergency parliamentary sitting which resulted in the sacking of speaker of parliament Ali Ga'al Asir and Haaf's deputy Mohamed Haashi Abdi Arabey in a vote of no confidence, local media Radio Shabelle reported.
Haaf was impeached last week by a section of parliament after supporting the Saudi-UAE led faction of the Gulf crisis and calling on the federal government to change its neutral position due to its good relations with Saudi Arabia and the United Arab Emirates.
The vote of no-confidence by a section of parliament opposing his stance resulted in a political crisis with three other states accusing the federal government of accepting the impeachment quickly due to its disagreement with Haaf over his stance in the Gulf crisis.
They called on the federal government to nullify the impeachment and re-instate Haaf. This was done after some mediation talks.
"The misunderstanding between the Federal Government and the states over the Gulf issue has led to a targeted campaign by the Federal Government against Galmudug to remove the state president. The statement from the government is evidence of this move," the states of Jubaland, Puntland, Hirshabelle, and South West said.
"If the political crisis facing the country continues, coordination between the Federal Government and Federal Member States will deteriorate and this will significantly affect the war on terror," they added in a joint statement.
The Galmudug president welcomed the decision to oust the speaker of parliament and his vice president in a statement in which he declared the state of emergency that started on Oct 1.
In separate development, a policeman shot dead the chief of security at an airport in Somalia's semi-autonomous Puntland region and also his bodyguard, police in BOSSASO said.
The assailant's motive for killing Colonel Abdisalan Sanyare Owke and his bodyguard at the airport in Galkayo, a city in Puntland, was not immediately clear.
Police detained the assailant and have begun an investigation of the incident.
Somalia has been mired in conflict since 1991, but Puntland has been spared most of the violence. It has a dispute with the neighbouring semi-autonomous region of Galmudug that has in the past resulted in fighting.
Al-Shabaab, the militant group that aims to topple Somalia's Western-backed govrnment, has become more active in Puntland after being pushed out of its stronghold further south by African Union peacekeepers and the Somali army, officials say.