Abdirahman Ahmed was a prominent politician in Kismayo
An Islamist militia has executed a Somali politician who they accused of betraying his religion by working with non-Muslim Ethiopian forces.
An Islamist spokesman in the port of Kismayo told the BBC that Abdirahman Ahmed was shot dead on Thursday.
Mr Ahmed was also accused of spying for Ethiopian forces, said to be backing the forces of warlord Barre Hiraale in trying to recapture Kismayo.
He is believed to be the first politician executed by the Islamists.
Ethiopian forces are pulling out of Somalia, two years after they intervened to try to oust Islamists from the capital Mogadishu.
But their mission to prop up the interim government is widely regarded as a failure as various Islamist group have recently advanced and once more control much of the country.
A group of hardline Islamists retook the coastal city of Kismayo last August.
Islamist authorities in the city stoned a 12-year-old girl to death for adultery in November, although her aunt said she had been raped.
In Mogadishu, thousands of people have gathered at the football stadium, a former Ethiopian base, to celebrate the withdrawal of Ethiopian forces.
Talks about power-sharing between moderate Islamists and the government earlier resumed in neighbouring Djibouti.
Relatives of Abdirahman Ahmed - also known as Waldiire - told the BBC he did not have a lawyer present during his trial in a Sharia court.
They say he was arrested about a week ago and they were informed of his death sentence on Thursday morning.
Sheikh Hassan Yakub - the spokesman for Kismayo's Islamist administration - told the BBC's Somali Service that Mr Ahmed had admitted during his interrogation that he worked with those backed by Ethiopia.
Different Islamist groups now control much of the country
This, he said, was the basis for the court's opinion that he had changed his religion.
The relatives said they had asked the authorities to allow Mr Ahmed to go into exile.
But he was executed after afternoon prayers on Thursday.
After the shooting, his brother pleaded to be able to bury his body, however, he was told the burial had already been done.
Mr Ahmed used to be the spokesman for the Jubba Valley Alliance - one of the factions which battled for control of Somalia during the 1990s.
Earlier this month, Mr Hiraale and his fighters took some towns from the hardline Islamist group al-Shabab in Gedo region, north of Kismayo.
Observers at the time said Mr Hiraale was being armed by the withdrawing Ethiopian troops - an allegation he denied.
Al-Shabab is on the US list of terrorist groups.