Somalia (search) has become a safe haven for terrorists in East Africa and the government-in-exile must take power to restore law and order to the Horn of Africa nation, the commander of a U.S. counterterrorism task force said Friday.

U.S. Marine Maj. Gen. Samuel Helland, the commander of the Combined Joint Task Force-Horn of Africa, said American troops were working with Somalia's neighbors to improve their border security since U.S. pressure on the al-Qaida terror group in Pakistan and Afghanistan may force some members to seek refuge in East Africa.

"Somalia is a safe haven, it is ungoverned space," Helland told The Associated Press in an interview from his headquarters in Djibouti (search). "We, the international community, have to do something to take away that safe haven."

He said Somalia's government-in-exile, formed last year in Kenya after three years of peace talks, needs to assert itself inside Somalia and introduces law and order.

On Thursday, the African Union authorized deployment of 1,700 peacekeepers to Somalia to help secure the transitional government as it heads home. The Ugandan and Sudanese troops will be deployed in the towns of Baidoa and Jowhar, from where the government will operate temporarily because the Somali capital is unsafe, the AU's Said Djinnit said.

Somalia has been without a central government since clan-based warlords overthrew dictator Mohamed Siad Barre (search) in 1991. Warlords then turned on each other, plunging the Horn of Africa nation of 7 million into anarchy. Somalia's government has been based in neighboring Kenya since it was formed in 2004 because the capital, Mogadishu, is considered unsafe.

The government is opposed by Islamic extremists and some of the dozens of warlords in the country.

Ethiopian Prime Minister Meles Zenawi told AP on Thursday that an al-Qaida terror cell was "very active" in Mogadishu, but that a Somali government was the best bet for dealing with the problem.

Helland spoke to AP as he prepared to end his one-year command of the task force.

The Combined Joint Task Force-Horn of Africa, set up in Djibouti in June 2002, is responsible for fighting terrorism in nine countries around the Horn of Africa: Djibouti, Eritrea, Ethiopia, Sudan, Kenya, Tanzania, Uganda and Somalia in Africa and Yemen on the southwestern corner of the Arabian Peninsula.