Militant Islamist insurgents fired mortars towards US congressman Donald Payne as he left Somalia yesterday after a rare visit by a US politician to the anarchic Horn of Africa nation.

The attack came a day after US forces killed three pirates in an assault off Somalia that freed an American hostage.

The al Shabaab insurgents, whom Washington accuses of being al Qaeda's proxy in Somalia, claimed responsibility for the mortar attack, saying it was a message to the United States.

"We fired on the airport to target the so-called democratic congressman sent by (US President Barack) Obama," Sheikh Hussein Ali, a spokesman for al Shabaab, told Reuters.

"Let him go back with the message of our strength and enmity towards the US and its allies. No single group can claim control of Mogadishu, and al Shabaab will continue its attacks."

Mr Payne was unharmed.

Somalia's capital Mogadishu is one of the world's most dangerous places. US officials and politicians have shunned travel to the battle-scarred city due to constant violence.

Somali Internal Security Minister Omar Hashi Aden said Mr Payne's plane was just airborne when the mortars fell. A police officer, however, said one mortar struck the airport before Mr Payne left and five others impacted after.

Residents said insurgents and African Union (AU) peacekeepers exchanged fire after the attack, killing three civilians and wounding 12 other people near a market.

Ahmed, a local mechanic, said mortars came into the area where the insurgents had fired from. "I cannot make out if those injured ones are the civilians or the ones who fired," he said.

Congressman Payne spoke with the interim government's President and Prime Minister during the short visit.

He brought six bodyguards with him, and AU soldiers provided extra security.

Mr Payne, 74, a New Jersey Democrat, defended the US assault to free American ship captain Richard Phillips. Some fear it may stir more violence and anti-American sentiment.

"If there were no pirates, the US government would not have intervened... Every country has a right to defend its citizens," Mr Payne told reporters before leaving.

Mr Payne is chairman of the House of Representatives' Foreign Affairs Subcommittee on Africa and Global Health.

Sign up to our free newsletters

Get the best updates straight to your inbox:
Please select at least one mailing list.

You can unsubscribe at any time by clicking the link in the footer of our emails. We use Mailchimp as our marketing platform. By subscribing, you acknowledge that your information will be transferred to Mailchimp for processing.