The Somali government has accused U.S. forces of carrying out an airstrike earlier this week which killed 13 Somali soldiers.

The Somali government on Thursday demanded an explanation from the U.S. for the airstrike, expressing concerns that American forces may have acted on a false tipoff from the rival, semi-autonomous Puntland state.

The confusion over who launched the attack in the early hours of Wednesday deepened after the Pentagon denied it targeted Somali forces but said it did carry out an airstrike in the same area that killed nine Islamic extremist fighters from al-Shabab.

Photos of the aftermath of the attack showed the burned out shells of two armored vehicles and bodies burned beyond recognition. The bodies, covered in white shrouds, were later buried outside Galkayo town, as hundreds of mourners protested the attack and vowed retaliation for the soldiers' deaths. Galkayo is a town divided between the rival states of Puntland and Galmudug.

"We believe that such behavior will not serve the positive spirit and energy of fighting terrorism," said a statement from the Galmudug administration. It asked the U.S. for an apology and compensation for the victims. The Galmudug state also warned that the strike would divert attention from fighting Islamic extremism to a political rivalry, apparently with its rival Puntland state.

In an earlier airstrike the U.S. killed four al-Shabab extremists on Monday. The attack was conducted after extremists launched attacks on Somali troops and their U.S. advisers on Monday near the port city of Kismayo, the U.S. Africa command said in a statement.

U.S. forces have carried out several airstrikes in Somalia in recent years, killing many al-Shabab leaders. The extremist group is now mostly active in rural regions but continues to launch lethal attacks in many parts of this Horn of Africa nation, including the capital.