al-Shabaab fighters
A file photo of Somalia-based al-Shabaab fighters - (Reuters)

The US has confirmed carrying out separate raids in Somalia and Libya targeting top Islamist militants in the region while capturing a senior al-Qaida figure in Tripoli.

In the Libyan capital, the US forces are said to have apprehended 49-year-old Abu Anas al-Liby.

However, the Pentagon has said the Somalia raid, which was aimed at the al-Qaida-backed al-Shabaab group, was unsuccessful in seizing a wanted militant. The high-profile al-Shabaab operative is suspected to have played a key role in the Westgate mall siege in the Kenyan capital Nairobi.

Officials are tight-lipped over the specifics of the anti-terror operation.

"US personnel took all necessary precautions to avoid civilian casualties in this operation and disengaged after inflicting some al-Shabaab casualties. We are not in a position to identify those casualties," said Pentagon spokesperson George Little.

Although the Somalia operation appears to have been pre-planned, it was triggered by the Kenya siege.

None of the US troops were injured or killed during the raid. Both the Somali and Libyan governments are said to have been informed of the raids in advance.

Al-Liby, the al-Qaida militant detained in Tripoli, was responsible for the US embassy bombings in East Africa which killed 224 people and injured 5,000 others in 1998.

"As the result of a US counterterrorism operation, Abu Anas al-Liby is currently lawfully detained by the US military in a secure location outside of Libya," said Little.

The militant was listed in FBI's "Most Wanted Terrorists" file and the State Department's Rewards for Justice Programme had announced a $5m (£3.1m) reward for any information leading to al-Liby's arrest.

"As I was opening my house door, I saw a group of cars coming quickly from the direction of the house where al-Ragye [Liby's] lives. I was shocked by this movement in the early morning. They kidnapped him. We do not know who are they," an unidentified resident in the region told Reuters.

The US has been continuously targeting top al-Qaida figures after the killing of the Islamic militant outfit's leader Osama Bin Laden in 2011.