Somalia's government has ordered the top United Nations official in the country to leave, accusing him of interfering with national sovereignty days after he raised concerns about the actions of UN-supported Somali security forces.

The foreign affairs ministry said on Tuesday that Nicholas Haysom, the Special Representative of the UN Secretary-General for Somalia, "is not required and cannot work in this country", effectively declaring the official persona non grata.

"The decision comes after he openly breached the appropriate conduct of the UN office in Somalia," a statement read.

Haysom sent a letter dated December 30 to the interior security minister expressing concern over "the alleged involvement of UN-supported Somali security forces in the arrest of Mukhtar Robow on 13 December, the deaths of 15 civilians...on 13, 14, and 15 December...and the arrest of approximately 300 people involved in the demonstrations on 13, 14, and 15 December".

Robow, the individual referred to in the letter, is a former member the armed group al-Shabab whose bid to become a regional leader in the country in an election last month was blocked.

The Internal Security Ministry said that Robow was arrested on suspicion that he had brought fighters and weapons back to the southern city of Baidoa, the capital of South West region where he is running for president.

His arrest sparked clashes between militiamen loyal to Robow and Somali forces. Ethiopian security forces, who are part of an African Union peacekeeping force in Somalia, were also involved in the violence.

There was no immediate comment from the UN mission in the country.

{articleGUID}

The decision comes hours after the UN compound in the Somali capital of Mogadishu was attacked. Seven mortars landed inside the compound which led to the wounding of two UN staff members and one contractor. The Secretary-General of the UN Antonio Guterres strongly condemned the attack and urged the Somali authorities to "investigate the attack and bring those responsible to justice".

Al-Shabab has reportedly claimed responsibility of the attack according to a statement by the UN.