At least four people have been killed in a car-bomb attack close to the heavily fortified gates of the airport in Mogadishu, Somali police say.

Both the airport and the adjoining UN mission have been frequently targeted in the past by the Somali armed group al-Shabab, which is fighting to overthrow the country's internationally backed government.

In a statement, AbdiAziz Musab, al-Shabab's military spokesman, claimed responsibility for Wednesday's attack in the airport zone.

"Our Mujahideen based in Mogadishu have today targeted a convoy of foreign mercenaries and their apostate allies nearby the airport," he said.

Witnesses said the UN convoy targeted consisted of four armoured vehicles escorted by private security personnel driving in pickups.

UN convoys are systematically flanked by pickup vehicles carrying private security officers who provide protection for international staff.

"The bomber drove in between UN armoured vehicles and its security escort and detonated the car, ramming into one of the escort vehicles," Mohamed Liban, a police officer, told the AFP news agency.

A number of foreign diplomatic missions are based inside the airport zone, which has also been used to house a number of UN staff since a UN compound in Mogadishu's city centre was attacked by al-Shabab last year.

The airport zone is also the base of the 22,000-strong African Union force fighting the al-Shabab.

The attack appeared to be a repeat of an al-Shabab operation in February, when seven people - Somali guards, passers-by and shop owners - were killed in a suicide attack on a convoy carrying UN staff near the airport.

Al-Shabab fighters have carried out a string of attacks in Mogadishu this year, including against the presidency, parliament and intelligence headquarters.

Al-Shabab has also stepped up operations in Kenya, and on Tuesday killed 36 non-Muslim quarry workers in a Kenyan border town.