The Islamist militia al-Shabaab claimed responsibility for an attack on a residential compound belonging to the Turkish embassy in Somalia's capital Mogadishu, dpa reported.
A car bomb exploded Saturday outside the building in the Hodan district. Four people, including a Turkish policeman stationed at building and a Somali civilian, were killed.
Three Turkish citizens were among the several people wounded. The body of the policeman and his three wounded colleagues would be flown to Ankara, Turkey's Anadolu news agency reported.
Embassy security personnel had prevented the attackers from entering the building and setting off more explosives, said Mohamed Abdi Warsame, Hodan police commissioner.
Two attackers with explosive devices were killed by shots to the head, he said, adding that parts of the compound were damaged.
The governments of Turkey and Somalia condemned the attack. A Somali presidential spokesman told Anadolu the attackers wanted Turkey to stop helping the country.
In mid-June, al-Shabaab also claimed responsibility for an attack on a United Nations building in Mogadishu that killed 15 people.
The al-Qaeda-affiliated group was largely driven out of Mogadishu in 2011 by government soldiers and African Union troops, but it is still able to carry out attacks there. It is also active in southern Somalia.
Turkey is a key player in Somalia, providing humanitarian aid and state-building assistance to the war-torn nation.