Suicide bombers have attacked Somalia's main airport in Mogadishu, killing soldiers and civilians, officials say.
The attackers used two cars - the first exploded at the airport entrance, but a number of insurgents jumped out of the second car and opened fire, killing two African Union (AU) peacekeepers.
Five militants reportedly blew themselves up as they tried to reach the airport terminal.
The hard-line Islamist group al-Shabab group said it carried out the attack.
Officials and witnesses said all of the militants involved in the attack had died, and two women who were begging outside the airport's entrance were among those killed.
The number of civilians who died is still unclear. The government confirmed three deaths, but some officials and witnesses said at least nine people had died, and some reports claimed that Somali police officers had also been killed.
Minister of Information Abdirahman Omar Osman said in a statement that al-Shabab had ignored pleas to allow people to celebrate the Muslim holy month of Ramadan in peace.
"They have deliberately triggered violence across the city, killing and injuring civilians and soldiers alike," he said.
"They offer nothing but terror, intimidation and the defiling of our culture."
Airport officials told the BBC that AU forces had stopped the first vehicle as it drove towards the airport's main entrance.
The vehicle exploded, and shortly afterwards insurgents arrived in another vehicle and began shooting.
The explosion was initially understood to have been a car bomb, but an official from the AU's Somali mission (Amisom) later said that AU troops had destroyed the car.
"The lead car was destroyed by an RPG [rocket-propelled grenade] fired by one of our soldiers, and it exploded at the main entrance," Amisom spokesman Bahoku Barigye told the AFP news agency.
Mohammed Abdi, a local shopkeeper, told Reuters news agency that he had witnessed two explosions at the airport's heavily fortified main entrance.
"The car powerfully rammed an Amisom troops' post at the airport's gate," he said.
Mogadishu's airport, of huge strategic importance, is one of the few parts of the capital controlled by forces from the AU and the government.
In recent weeks, al-Shabab has stepped up the intensity of its insurgency.
On Wednesday, 11 people were killed in clashes between al-Shabab fighters and Somali troops.
In the worst single attack, gunmen from the Islamist group stormed a hotel last month and killed at least 32 people, including four MPs.
The government had said that it expected a surge in rebel activity as Ramadan drew to a close.
Al-Shabab is fighting to overthrow the government and install its own radical interpretation of Islamic law.
Al-Shabab and other Islamist rebels control large parts of the country, while the government holds only small parts of Mogadishu.