Updated

U.S. Defense Secretary Leon Panetta said Tuesday that U.S. operations against Al-Qaeda are now concentrating on key groups in Yemen, Somalia and North Africa.

Panetta said efforts against the Al-Qaeda affiliates depend on American partnerships with countries like Djibouti. The military base in this tiny port nation in the Horn of Africa is the launch point for U.S. drones used for intelligence, surveillance and, at times, strikes against insurgents in terror hotspots.

Panetta told troops stationed at the base that he will visit Libya, becoming the first Pentagon chief to travel to the embattled country, which is emerging from an eight-month civil war.

He said he will also travel to Iraq in the coming days for a ceremony that will shut down the U.S. military mission there after nearly nine years at war.

As the U.S. winds down operations in Iraq and begins its methodical withdrawal from Afghanistan, the U.S. military has increasingly focused on Africa -- particularly the north, where insurgents have found sanctuary.

"It's fair to say that the United States is intent on going after Al-Qaeda wherever they locate, and making sure they have no place to hide," said Panetta, who is making his first trip to Djibouti.

A key U.S. ally in this region, Djibouti has the only U.S. base in sub-Saharan Africa. It hosts the military's Combined Joint Task Force-Horn of Africa.

U.S. officials have acknowledged that as the threat from core Al-Qaeda leaders in Pakistan declines -- largely due to U.S. strikes that have killed insurgents or kept them on the run -- affiliated groups in Africa and Yemen have taken on more active and dangerous roles.

The worry is that militant groups -- including al-Shabab in Somalia and Al-Qaeda in the Arabian Peninsula in Yemen -- operate out of safe havens in undergoverned spaces.

"Our goal is to make sure that wherever they go, we go after them and make sure that they are not able to ever develop the kind of planning that would involve attacks on our homeland," Panetta told reporters traveling with him.

Militants based in Somalia and Yemen have been at the heart of a number of deadly terror attacks in the region, and several near-misses in the U.S.

The Somalia-based al-Shabab, which is linked to Al-Qaeda, unleashed twin bombings in Kampala, Uganda, that killed 76 in 2010. The group is particularly worrisome because it has recruited dozens of Somali-Americans, particularly young men, to travel to Somalia and take up the fight.

On Christmas Day 2009, a Nigerian man tried to blow up an airliner over Detroit during a flight that originated from Lagos, Nigeria.

U.S. and European officials also worry that Al-Qaeda in the Islamic Maghreb -- which operates in the west and north of Africa -- is working to establish links with al-Shabab and the Nigerian group Boko Haram.

Panetta met with Djibouti President Ismail Omar Guelleh as well as some of the roughly 3,000 U.S. troops that are based here, conducting counterterrorism, counter-piracy and humanitarian missions.

U.S. defense officials said Djibouti is planning to deploy some troops to the Somalia mission, joining forces from Uganda and Burundi who are working to push al-Shabab back, particularly from key areas around the capital region.

Panetta's plan to visit Libya comes amid ongoing violence there, including recent clashes between revolutionary fighters and national army troops near Tripoli's airport.

Panetta said Libya reflects the ongoing changes in the region after the Arab Spring, and said the U.S. wants to help Libyans move in the right direction as the people take back their country. With military assistance from the U.S. and NATO, Libyans ousted and later killed longtime leader Muammar Qaddafi earlier this year.