(Adds new quotes, context)
MOGADISHU, Dec 6 (Reuters) - A Somali lawmaker was killed in the capital Mogadishu on Friday when a bomb planted under his car exploded at the entrance to the heavily fortified compound of the presidential palace, a senior police official said.
It was not immediately clear who had carried out the attack. A senior police officer manning a roadblock at the entrance to the hilltop palace compound said Warsame Faysal had just returned to his vehicle after prayers.
"As he drove past the prime minister's residence, the car bomb exploded," legislator Tahlil Abdi told Reuters by telephone from the morgue where Faysal's body was taken.
Although security has markedly improved in Mogadishu since Islamist militants were driven out of the city by African troops two years ago, suicide attacks and assassinations remain relatively common.
The Islamist rebel group Al Shabaab has claimed responsibility for many of the strikes in the heart of the city. (Reporting by Abdi Sheikh and Feisal Omar; Editing by Richard Lough and Kevin Liffey)