Somalia's government has rebuked its three semi-autonomous regions for cutting ties with Qatar, saying it was determined to stay neutral in the Gulf state's dispute with other Arab states.

The region of Galmudug issued a statement on Wednesday saying it stood with the United Arab Emirates and Saudi Arabia in the regional dispute, following similar declarations last month by the regions of Puntland and Hirshabelle.

Somalia's federal government responded on Thursday by saying only it had the authority to speak on foreign affairs.

Saudi Arabia, the UAE, Bahrain, and Egypt cut political and trade ties with Qatar on June 5, accusing it of "supporting terrorism" and their regional rival, Iran - charges that Qatar vehemently denies.

The spat over this crisis in volatile but strategically located Somalia illustrated how far the political ripples from the Gulf dispute have spread.

Somalia's open stance is important for Qatar - Somalia's airspace remains open for Qatar Airways, a critical lifeline amid the blockade.

Arab Gulf states have meanwhile been pouring resources into the semi-autonomous regions.

"[The Arab states] are trying to give more energy and emphasise more their relations with these regional governments, trying to pressure them to go against the federal government," said Nairobi-based Somalia expert Ahmed Roble.

Somalia's position also underlines its delicate position - dependent on trade from Saudi Arabia, but increasingly close to Turkey, which is backing Qatar in the dispute.

READ MORE: Qatar-Gulf crisis - All the latest updates

Saudi Arabia is Somalia's top export partner, and the UAE supplies the Horn of Africa country with key imports from electronics to building materials.

Turkey has poured in more than $1bn in aid into the country since President Recep Tayyip Erdogan's visit to Somalia in 2011 and is expected to open a military base in the capital Mogadishu this month.

"The cabinet reaffirms the federal government's decision in June ... that Somalia is neutral about the conflict of Gulf countries," read a statement issued by the office of Prime Minister Hassan Ali Khaire.

The statement called on "the conflict be solved brotherly, peacefully and diplomatically".