Secretary of State John Kerry said Sunday terrorists "can run but they can't hide" after Navy SEALs raided the house of a top leader of the Somali group al Shabaab and separately captured in Libya an al Qaeda leader wanted for bombing U.S. Embassy in 1998 in east Africa.

"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," Reuters quoted Kerry as speaking from the Indonesian island of Bali on Sunday, a day after U.S. counterterrorism operations in Somalia and Libya.

"Those members of al Qaeda and other terrorist organizations literally can run but they can't hide," Kerry said ahead of an Asia-Pacific summit. "We will continue to try to bring people to justice."

The Pentagon said U.S. forces in Libya's capital Tripoli captured on Saturday Nazih al-Ragye, alias Abu Anas al-Liby, who had been indicted for his role in the bombings of the American embassies in Kenya and Tanzania in 1998 that killed 224 people.

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

Al-Libya was on the FBI most wanted list with a $5 million reward.

In Somalia, Navy SEALs raided the seaside villa of "a known al Shabaab terrorist" on the Somali port of Barawe. However, the group's leader was neither captured nor killed, an anonymous official, who refused to identify the target, told Reuters.

U.S. forces had to pull out to avoid civilian casualties after one of the militants was killed and the exchange of fire escalated. None of the SEALS was injured or killed.

The troops raided a building believed to be a hideout for al Shabaab, including its top leader Ahmed abdi Godane, whose nom de guerre is Moktar Ali Zubeyr, according to CNN.

The strike was planned following the raid on the Westgate shopping mall in Nairobi, Kenya by al Shabaab two weeks ago that killed at least 68 people and injured more than 175 others, according to The New York Times.

Barawe residents said the strike began at about 3 a.m. local time on Saturday. "We were awoken by heavy gunfire last night, we thought an al Shabaab base at the beach was captured," a resident, Sumira Nur, told Reuters. "We also heard sounds of shells, but we do not know where they landed."

Al Shabaab claimed responsibility for last month's Westgate terror attack on its Twitter feed, saying: "The attack at #WestgateMall is just a very tiny fraction of what Muslims in Somalia experience at the hands of Kenyan invaders… For long we have waged war against the Kenyans in our land, now it's time to shift the battleground and take the war to their land."

Kenyan troops are fighting Islamist terrorist groups in Somalia, where al Shabaab controls most of the southern parts.

Al Shabaab has reportedly been recruiting members of Somali-American families, especially the relatives of those who have died in anti-terrorist operations in Somalia, in the two U.S. states. A federal grand jury in 2010 charged 14 people in the United States with aiding al Shabaab.