Kenyan troops will stay in southern Somalia until Kenyans feel safe again, the chief of Kenya's armed forces said Saturday, raising questions about whether Kenya risks becoming bogged down in an open-ended occupation of its war-ravaged neighbor.

As he spoke, at least 10 people died during an insurgent attack on an African Union base in the Somali capital of Mogadishu, a Somali military official said.

"They were dressed in Somali military uniform and disguised as ordinary soldiers," said Col. Nor Abdi. "Then they tried to enter the base and AMISOM soldiers fired at them. Then heavy gunfire started and all of them were killed. I don't know how many they were but they were more than 10 men."

Resident Mohammed Abdi says he heard several large explosions near the base. The gunfight lasted for several hours and the final number of casualties was unclear.

AU troops have been in Somalia since 2007 and now control almost all the capital. But they still suffer frequent attacks.

That did not deter Kenya from sending troops into Somalia earlier this month following a string of cross-border attacks and kidnappings blamed on Somali gunmen and al-Qaida-linked al-Shabab militants battling the weak U.N.-backed government. Gen. Julius Karangi told reporters that Kenya does not have a timeframe for leaving.

"When the Kenya government and the people of this country feel that they are safe enough from the al-Shabab menace, we shall pull back," Karangi said. "Key success factors or indicators will be in the form of a highly degraded al-Shabab capacity."

Both U.N. and Ethiopian forces sent forces into Somalia at different times during its 20-year-old civil war but were forced to withdraw without ending the conflict.

Karangi says Kenya has no interest in permanently occupying Somalia and is working alongside the weak U.N.-backed Somali government, which only holds the capital with the help of 9,000 AU soldiers. The Somali president has criticized the Kenyan intervention but Kenyan officials said they expected "clarification" from a high-level Somali delegation on Monday.

So far Kenya has suffered one fatality due to al-Shabab fire, Karangi said, although five people were killed when their helicopter crashed. He said hundreds of al-Shabab were believed to be killed although he had no way of confirming that directly. Al-Shabab militants have mostly withdrawn without fighting Kenyan forces.

Karangi says that although Kenya has bilateral military agreements with countries like the United States and Britain, those allies are not directly militarily involved in the incursion into Somalia.

"There has been a lot of talk about other friends of ours participating militarily in what we are engaged in, and the answer is no," he said. "I think the American ambassador yesterday made it very clear ... that they are not militarily involved in the campaign with us."

Somalia has not had a functioning government since warlords overthrew a socialist dictator in 1991. More than 600,000 Somali refugees have fled the fighting and famine in their homeland and now live in Kenya. The Kenyan government is deeply worried about the rapidly swelling refugee camps in the north, which it considers a severe security problem.