A suicide bomber has used a vehicle packed with explosives to attack the Somali interim prime minister's residence in the capital, Mogadishu.
Bodyguards shot the bomber before he reached the target
At least six people died and 10 were injured - most of them bodyguards.
Speaking to the BBC, Prime Minister Ali Mohamed Ghedi described the blast as huge, saying it had blown in all the windows but left him unhurt.
Mr Ghedi later said it had been "an al-Qaeda masterminded terrorist attack" aimed at destabilising the country.
"The terrorists wanted to discourage the government and Somali nation, but they will never succeed," Mr Ghedi said.
Mr Ghedi has been targeted by would-be assassins at least three times since he returned to Somalia in May 2005.
"I was in my office, the second floor of my residence building, meeting with some government officials and, immediately after the event, all the windows, all the equipment has been destroyed with the explosion," Mr Ghedi told the BBC as he described the latest attack.
"But fortunately, we are safe - myself and the other government officials and also my family members - even though we have lost the lives of my security officers and other people around the same area."
A BBC correspondent in Mogadishu, Mohammed Olad Hassan, was in the vicinity when the explosion occurred and described what happened:
"A suicide bomber drove through the security barrier of the prime minister's bodyguards. The bodyguards opened fire on the car. They shot the suicide bomber before he reached his target, and he exploded the car against the wall of the prime minister's house," he said.
"Prime Minister Ali Mohamed Ghedi was inside the building, but the man couldn't reach the target."
Very quickly after the blast Somali and Ethiopian troops sealed off the roads in the area, our correspondent says.
Mr Ghedi was evacuated to a safe location, said Paddy Ankunda, a spokesman for the African Union peacekeeping force in Mogadishu.
The African Union has a few hundred Ugandan peacekeeping troops in the city, but they have played little role in the current unrest.
There have been continuing attacks on government targets by local militia and Islamist militants since Ethiopian forces crossed into Somalia last year to install the transitional government in Mogadishu.