Somalia: Failed State
Lighting up Somalia
Struggle for unity
In pictures: Camp life
Two top Islamist militants, from the US and UK, have been killed in Somalia after falling out with al-Shabab, witnesses have told the BBC.
Omar Hammami, known as al-Amriki, and Osama al-Britani, a British citizen of Pakistani origin, are said to have died in an early-morning attack in a village south-west of the capital, Mogadishu.
They had been hiding from al-Shabab since leaving the group this year.
There have been several previous reports of al-Amriki's death.
In March, the US State Department offered a $5m (£3.1m) reward for any information leading to the capture or conviction of al-Amriki.
One of al-Amriki's fighters told the BBC that they had been overpowered by the al-Shabab attack in a village near the town of Dinsor.
Fatwa denouncing al-Shabab:
Al-Shabab has strayed from the correct path of Islam
The Somali government is an Islamic administration; it is forbidden to fight against it
Al-Shabab must atone to God and must cease its erroneous ideology and criminal actions
It is forbidden to join, sympathise or give any kind of support to al-Shabab.
It is a religious duty to refuse shelter to al-Shabab members
It is a taboo to negotiate on behalf of al-Shabab members in custody or release them from jail
Somali officials have a religious duty to protect the Somali people from al-Shabab's atrocities - as do the public to help them in their security operations against the group.
Fatwa issued against al-Shabab
He said al-Shabab had taken away the bodies of the two Westerners.
Another of their allies, Khadap al-Masari, from Egypt, surrendered, the fighter said.
Local residents confirmed the deaths, as did a senior source within al-Shabab.
"There was a gun battle between al-Amriki and his men and other fighters," Moalim Ali, a resident in Bardhere village, told the AFP news agency.
Another resident, Mohamed Wardhere, said: "Al-Amriki and two other fighters, one of them a foreigner, have been killed near Bardhere."
The two men were allies of veteran Somali Islamist, Sheikh Hassan Dahir Aweys, who split from al-Shabab in June.
He is currently in the custody of the UN-backed government.
BBC Somali analyst Mohamed Mohamed says al-Shabab has been hunting down and killing allies of Mr Aweys since the split.
Mr Aweys is seen as less hardline than al-Shabab leader Ahmed Abdi Godane, who also has a more international agenda.
Al-Amriki was known for rapping jihadist songs which were loaded onto YouTube.
He grew up in the town of Daphne in the state of Alabama, where friends said he was popular at school, quick-witted, charismatic and elected president of his school year.
According to his schoolfriend, James Culveyhouse, his father is a Sunni Muslim from Syria and his mother a Southern Baptist Christian.
Mr Culveyhouse told the BBC in 2011 that al-Amriki's radicalisation started after a visit to Syria as a teenager.
Over the years he became an adherent of stricter and stricter Islam - turning far more orthodox than his father.
He moved to Somalia in 2006 and joined al-Shabab, becoming one of the group's senior officials.
Back on Twitter
Little is known about al-Britani.
UK officials say they have been aware of the Briton's presence in Somalia for some time but would not confirm either his death or his real name.
BBC Security correspondent Frank Gardner says there have been fears that British jihadists heading to Somalia would return to the UK to carry out attacks but officials say their numbers are now dwarfed by those going to fight in Syria.
The news of the killings of the foreign militants in Somalia comes a day after a group of 160 leading Islamic scholars issued a fatwa denouncing al-Shabab, saying the group had no place in Islam.
Nairobi-based Somali analyst Mohamed Abdullahi told the BBC's Newsday programme that the fatwa, issued by so many prominent scholars, is likely to sway opinions on the ground, but is unlikely to change the path of those in the group's top leadership.
"[It says] you cannot give them sanctuary, you cannot support them, you have to report their presence and you have to assist international security agencies so the fatwa includes a security element of community policing against al-Shabab," he said.
But it should be coupled with other efforts to win the hearts and minds of people on the ground, he added.
"There must be another parallel programme to ensure that those young men who joined for economic reasons, for instance, are provided with employment or opportunities."
The edict was announced at the end of a conference on tackling extremism organised by the government of President Hassan Sheikh Mohamud.
He took office a year ago, vowing to end two decades of fighting in the country.
Last week, al-Shabab's Twitter account was suspended for a second time after claiming on its feed that it had ambushed the convoy of the president, who was unhurt.
It has since set up a new account.
Pro-government forces have pushed al-Shabab out of several key cities but the group still controls many smaller towns and rural areas.