A suicide car bomber killed at least 11 people on Wednesday near a hotel where lawmakers gather in the Somali capital, a sign of the fragile security situation in Mogadishu even after Islamist rebels pulled out last year.

Police officer Hassan Ali told Reuters the attacker rammed his vehicle into a cafe outside the Muna Hotel, in the heart of areas controlled by government and African Union forces and not far from the presidential palace.

Al Shabaab militants claimed responsibility. We were behind the explosion at the Muna Hotel. We targeted legislators and government officials, Sheikh Abdiasis Abu Musab, spokesman for al Shabaab's military operations, told Reuters.

Al Shabaab rebels dressed in army uniforms attacked the same hotel in August 2010, storming the building and killing more than 30 people.

The al Qaeda-linked militants pulled out of Mogadishu a year later but still pose an almost daily threat, even though U.N. and Western officials say 98 percent of the capital is now in government hands.

Shop fronts and cafe walls just outside the hotel were destroyed by the blast. African Union and government soldiers secured the area to move the dead and the wounded away.

Some people say the death toll is 15, but I have confirmed 11 civilians dead, a legislator was also slightly injured. It was a 4x4 suicide car bomb, police spokesman Abdullahi Barise told Reuters.

Police and the spokesman for African Union troops in Somalia said initial reports showed that the attacker first opened fire on people sitting near the hotel before detonating the car bomb.

Since pulling out of the capital, al Shabaab has launched frequent attacks against the Western-backed government with suicide bombers, roadside bombs and grenades.

A truck bomb killed more than 70 people in October in al Shabaab's most deadly single attack in the capital since launching an insurgency in 2007.

Wednesday's blast coincided with a visit to Mogadishu by the European Union's new special envoy and comes two weeks before a one-day conference in London to tackle the instability in Somalia and piracy off its shores.

British Foreign Secretary William Hague also visited Mogadishu last week and appointed a new Somalia ambassador, but said Britain would not open an embassy in Mogadishu until security improved.

(Editing by David Clarke)