New Year’s Day was greeted in Somalia by a mortar attack on Mogadishu airport. A fortnight earlier 62 al-Shabaab fighters were killed in 48 hours of airstrikes, the US announced. There were 52 fatalities from three car bombs in the capital two weeks before that, an attack that followed soon after 20 deaths from a truck packed with explosives.

Still the level of violence is said to be down, by Somali standards. The latest crisis for the country is one of international politics.

The government has expelled the UN special envoy to the country and this directly led to the British defence secretary, Gavin Williamson, cancelling a visit to Mogadishu and a meeting with President Mohamed Abdullahi Mohamed and his ministers while on a trip to the region.

The UN envoy, Nicholas Haysom, was asked to leave after he had questioned the arrest of Mukhtar Robow, the former deputy leader of al-Shabaab and one of the founders of the Islamist group, who had defected 18 months earlier and was running for a regional presidency. The special representative of the UN secretary general also raised concern over allegations of police brutality at protests which followed the detention.

Mr Robow was seized by Ethiopian troops, part of an international peacekeeping force, two weeks ago in the city of Baidoa and flown to Mogadishu. Twelve people, including an MP from the regional parliament, died in the ensuing violence and a government minister, from the area, resigned from President Mohamed’s government.

Nicholas Haysom, then the top UN envoy in Afghanistan, in 2015 (AP)

The arrest is viewed by Western officials as a blow against getting others in the Islamist hierarchy to lay down the gun and join the political process in a country that has been largely kept afloat through international aid. Mr Robow, who had fought with the Taliban in Afghanistan, is the most senior member of the group to change sides in a project to “turn” extremists, one which Britain has played an important part in putting together.

Mr Robow, The Independent understands, was rescued from al-Shabaab territory by US special forces in a mission with British help.

A western security official who was involved in the operation said: “His seniority and the standing of Robow in the community means that his defection was a big blow to al-Shabaab.

“Now what has happened to him will raise doubts among others who may want to come over. There are questions which need to be asked about who really gains from all of this.”

The UK, Germany and the European Union, it has been reported, have suspended financial aid to the police force from the Baidoa region for the time being. Mr Haysom wrote to the minister of internal security, urging that “appropriate action is taken to hold any perpetrators, including commanding officers, responsible”.

The UN Security Council adopted a British drafted proposal expressing “regret” at the expulsion of Mr Haysom, a South African lawyer and diplomat who was legal adviser to Nelson Mandela, and the expectation of “full cooperation between Somalia and the United Nations”. The Somali government, however, has told UN secretary-general Antonio Guterres that it will not accept Mr Haysom’s return.

The UK’s decision to condemn the UN envoy’s expulsion and cancellation of the defence secretary’s visit have, so far, drawn a muted reaction from the Somali government. A Somali website published a report which claimed that “sources” inside the Somali president and prime minister’s offices had “confirmed” that “explosives from the UK government” were used in a bombing in which 30 people were killed and that tail fins of mortar rounds showed they were “UK military”.

Somali government officials said that there was no evidence to back any of the allegations and wanted to stress that none of them had emanated from the office of the president or the prime minister. One official said that “it is unfortunate” that “such material is being put out so irresponsibly”.

But what happened to Mokhtar Robow, now in the intelligence service’s prison, provides a glimpse of the bitter divisions in this fractured society after decades of conflict, and the problems faced by the international community when dealing with a country beset by terrorism, poverty and economic collapse.

The Somali government claims that Mr Robow was trying to smuggle guns and infiltrate Islamist fighters into Baidoa. There is a feeling among some people here that the UN and European states are ignoring the anger generated by the murderous violence which had been unleashed by jihadi chiefs like him over the years.

Abdirahim Mohammed Hassan, a businessman whose 17-year-old son was killed in a bombing in Mogadishu three years ago, was adamant that the arrest was justified.

“This man has never said he was sorry, he has never condemned the violence. Why should someone like that be allowed to hold political power here?

“The Americans and Europeans are fighting al-Shabaab, so why do they want to allow people like that to establish themselves in the country? This will only create big problems in the future,” he added.

Among the international forces currently in Somalia is a 20,000-strong African Union force; just over 500 US troops and a British training team of around 100. There has been a rise in air strikes under the Trump administration, rising from 35 in 2017 to 47 last year.

Fighting for Freedom in the Somalian drought Show all 18 1 /18 Fighting for Freedom in the Somalian drought Fighting for Freedom in the Somalian drought Zeinab looks after one of her nephews Reuters Fighting for Freedom in the Somalian drought Zeinab's sister Habiba, 29, sits with her children beside their shelter at the camp Reuters Fighting for Freedom in the Somalian drought Zeinab helps her mother and sister build a new shelter Reuters Fighting for Freedom in the Somalian drought Women wait to fill their jerrycans at the camp Reuters Fighting for Freedom in the Somalian drought Zeinab and her sister Habiba carry a jerrycan filled with water to their shelter Reuters Fighting for Freedom in the Somalian drought Zeinab reads an English book in her shelter Reuters Fighting for Freedom in the Somalian drought Zeinab looks in the mirror as she brushes her teeth using a chewing stick Reuters Fighting for Freedom in the Somalian drought Zeinab cleans her feet before going into school Reuters Fighting for Freedom in the Somalian drought Zeinab at the entrance of her classroom near the camp Reuters Fighting for Freedom in the Somalian drought English teacher Abdiweli Mohammed Hersi in the classroom Reuters Fighting for Freedom in the Somalian drought Zeinab applies her make-up before heading to school Reuters Fighting for Freedom in the Somalian drought Zeinab writes in class Reuters Fighting for Freedom in the Somalian drought Zeinab attends a class Reuters Fighting for Freedom in the Somalian drought Zeinab's sister feeds her baby in the camp Reuters Fighting for Freedom in the Somalian drought Abdir observes Zeinab washing dishes as her nephews play REUTERS Fighting for Freedom in the Somalian drought Abdir carries a jerrycan while her daughter Zeinab washes dishes Reuters Fighting for Freedom in the Somalian drought Zeinab outside her shelter in the camp Reuters Fighting for Freedom in the Somalian drought The Hussein family at the camp for internally displaced people in Dolow

While al-Shabaab has lost territory and fighters they have significantly increased the number of bombings.

Hussein Sheikh Ali, the executive director of Somali think tank the Hiraal Institute, and a former national security adviser to the government, said: “Al-Shabaab is definitely not getting stronger, but the government is not getting stronger either. The US is very active. The US has been very active and hitting very serious targets but holding territory is very difficult.”

Around 560 people are estimated to have been killed in the US strikes since the start of 2017, according to researchers and confirmed by the US military, and the Islamists have also lost large numbers in ground fighting. This has led to complaints that al-Shabaab has increased the forcible recruitment of child soldiers in rural areas.

General Mohamed Ibrahim Sanyare, of the Somali national army, said: “This is a problem we are coming across. They go to villages and take away children. It is obviously very distressing for the families. We have rescued some of these children.”

Car bomb in Mogadishu, Somalia leaves several dead and wounded

But the Somali military, too, has been accused of using child soldiers. Gen Sanyara insisted it was an increasingly rare occurrence.

“This was something which happened in the past, especially when we were getting the tribal militias to integrate with the armed forces. Now if we find soldiers under the age [of 18] we definitely send them back to their homes and then they can rejoin when they are 18 if they pass the tests,” he said.

Nadifa Sheikh Omar, an adviser to the Somali president, spoke of the work being done in the field.

“We tell the communities, ‘Give them a pen, not a gun.’ We try to persuade them how getting involved in violence will ruin their lives” she said. “And of course it is not just boys but girls as well who are taken away, and these girls are exposed to sexual violence.

“We use the Quran to discuss the issues. We talk of Islamic teachings on violence, on child soldiers and sexual abuse.