Libyan Nazih al-Ragye, better known by the cover name Abu Anas al-Liby, was seized by US forces in Tripoli on Saturday, the Pentagon said. A raid on the Somali port of Barawe, a stronghold of the al-Shabaab movement behind last month's attack on a Kenyan mall, failed to take or kill its target.
Yesterday Libya's government, wary of an Islamist backlash, demanded an explanation for the "kidnapping" of one of its citizens. "We hope this makes clear that the United States of America will never stop in its effort to hold those accountable who conduct acts of terror," said Mr Kerry said during a visit to Bali.
"Those members of al-Qaeda and other terrorist organisations literally can run but they can't hide. We will continue to try to bring people to justice."
The target of the Somali operation was unclear but a US official was quoted as saying it was planned in response to the Nairobi mall attack two weeks ago in which at least 67 were killed.
That highlighted the risk of Somalia's rumbling civil conflict destabilising a resource-rich continent where Islamists have been on the rise from west to east in recent years.
Launched in the early hours of Saturday, the Somali raid appears to have featured a beach landing in hostile territory that was followed by an extended gun battle.
US officials said Navy SEAL special forces conducted the raid but, to avoid civilian casualties, disengaged after inflicting casualties on al-Shabaab.
Somali police said seven people were killed during the operation.
Somalia's Western-backed government, still trying to establish its authority after two decades of civil war, holds little sway in Barawe, 110 miles south of Mogadishu.
Asked of his involvement in the US operation, Prime Minister Abdi Farah Shirdon said: "We have collaboration with the world and with neighbouring countries in the battle against al-Shabaab."
In Tripoli, the seemingly bloodless operation to snatch Mr Liby as he returned home from dawn prayers at a mosque in the capital may have involved some cooperation with the friendly but weak Libyan administration - although the government issued a denial.
Mr Liby has been under US indictment since 2000 for his alleged role in bombing the US embassies in Kenya and Tanzania in 1998, which killed 224 people. Of more pressing concern for Washington, however, may have been that al Qaeda appears to be establishing itself in Libya.
With President Barack Obama wrestling with the legal and political difficulties posed by trying al Qaeda suspects held at the US base at Guantanamo Bay in Cuba, Mr Liby may be more likely to face trial in New York, where the indictment was filed.
Mr Liby, who had once been granted political asylum from former Libyan leader Colonel Gaddafi in Britain, was charged with 20 other people including bin Laden and current al-Qaeda leader Ayman al-Zawahri. The US government offered a £3 million reward for helping his capture.
He is accused of discussing the bombing of the Nairobi embassy in retaliation for the US intervention in the Somali civil war in 1992-93 and of helping plan the attack in the years before 1998.
Abdul Bassit Haroun, a former Islamist militia commander who works with the Libyan government on security, said the US raid would show Libya was no refuge for "international terrorists".