Approximately 25 people have been killed and more than 40 injured after Islamist militant group Al Shabaab set off a car bomb inside the compound of Central Hotel in Mogadishu, Somalia.

Those killed in the attack include several government officials and lawmakers.

Al Shabaab’s military operations spokesman Sheikh Abdiasis Abu Musab told Reuters: "We are behind the attack.

"12 hotel staff have reportedly been arrested in connection with the attack."

"We targeted government officials in the hotel; this is part of our operation in Mogadishu."

The militant group has been fighting in the country to oust the federal government supported by the West, and impose governance influenced by the Sharia law.

According to media reports, 12 hotel staff have been arrested in connection with the attack.

Somalia Internal Security Minister Abdirisak Omar Mohamed told Reuters: "(National intelligence) are going to interrogate the management of the hotel."

The militant group has targeted the luxury hotel on a busy day when government officials visit the mosque within the premises.

A suicide bomber is said to have ran into the mosque during Friday prayers to blow himself up.

Somali President Hassan Sheikh Mohamud said in a statement: "We are very sorry that the terrorists again attack Muslims in Friday prayer in a mosque in Central Hotel. We shall continue the fight against the terrorists."

The European Union called the attack ‘an act of terrorism by those who want to undermine progress towards a stable and secure Somalia’.