Secretary of State John Kerry said Sunday that a pair of raids conducted in Africa by U.S. special forces signaled the ongoing determination of the United States to bring terrorists to justice and sent the message that "members of Al Qaeda and other terrorist organizations literally can run but they can't hide."

The Pentagon confirmed Saturday night that U.S. special forces had captured alive Abu Anas al Libi in Tripoli, Libia. Libi, also known as Nazih Abdul-Hamed al-Ruqai, was wanted in connection with the 1998 bombings of the American embassies in Kenya and Tanzania. 

"On October 5, the Department of Defense, acting under military authorities, conducted an operation to apprehend longtime Al Qaeda member Abu Anas al Libi in Libia," Pentagon Press Secretary George Little said in a statement. "He is currently lawfully detained under the law of war in a secure location outside of Libia. Abu Anas al Libi has been indicted in the Southern District of New York in connection with his alleged role in Al Qaeda's conspiracy to kill U.S. nationals and to conduct attacks against U.S. interests worldwide, which included Al Qaeda plots to attack U.S. forces stationed in Saudi Arabia, Yemen, and Somalia, as well as the U.S. embassies in Dar es Salaam, Tanzania, and Nairobi, Kenya."

Multiple senior U.S. officials told Fox News that Libi is being held on a ship at sea. 

"Libi could be held at sea for a matter of weeks before he is turned over to law enforcement authorities," one senior U.S. official told Fox News.

Speaking Sunday at an economic conference in Bali, Indonesia, Kerry praised the "quality and courage" of the forces involved in the two actions and vowed that the United States "will never stop in the effort to hold those accountable who conduct acts of terror" and would "continue to try to bring people to justice in an appropriate way with hopes that ultimately these kinds of activities against everybody in the world will stop."

Sources told Fox News that Libi will be read his rights by an elite FBI unit that was sent out for that purpose. US officials say that the Justice Department plans to prosecute him in a U.S. court. 

Al Libi is on the FBI's most-wanted list with a $5 million bounty on his head. He was indicted by a federal court in the Southern District of New York, for his alleged role in the bombings of the United States Embassies in Dar es Salaam, Tanzania, and Nairobi, Kenya, on August 7, 1998, that killed more than 220 people.

He is believed to have spent time in Sudan where Usama bin Laden was based in the early 1990s. After bin Laden was forced to leave Sudan, al Libi turned up in Britain in 1995 where he was granted political asylum in Britain under unclear circumstances and lived in Manchester. He apparently fled Britain in 2000 when his name was added to the FBI's most wanted list.

The other Africa operation targeted the Al Shabaab militant group in Somalia linked to last month’s Kenya mall attack that killed more than 60 people.

In Somalia, the strike on Al Shabaab was carried out in the early hours before morning prayers in the seaside town of Barawe.

A resident said by telephone that heavy gunfire woke up residents before dawn prayers. The raid was carried out by US Navy SEALs, who came ashore and killed at least one individual at a villa where multiple high level Al Shabaab targets were supposed to be located. 

The targets were specifically wanted in connection with the Kenyan mall attack that left dozens dead. The leader of Al Shabaab, Mukhtar Abu Zubeyr, also known as Ahmed Godane, had claimed responsibility for the shopping mall attack in Nairobi.

According to Fox News sources, a shootout ensued when SEALs entered the Somali villa, with the SEALs subsequently unable to bring the body of one of the militants killed back with them. A senior U.S. official told Fox News that no U.S. personnel were injured in the operation, but one militant was killed.

Little confirmed the raid earlier Saturday, saying: "I can confirm that yesterday, October 4, U.S. military personnel were involved in a counter terrorism operation against a known Al Shabaab terrorist.  We are not prepared to provide additional detail at this time."

Foreign militaries -- often the U.S. but not always -- have carried out several strikes inside Somalia in recent years against Al Shabaab or Al Qaeda leaders, as well as criminal kidnappers.

Fox News’ Jennifer Griffin, Justin Fishel and the Associated Press contributed to this report.