Uhuru Kenyatta, Kenya's president, has told Somalia to "put their house in order," in a sign of frustration at the festering instability in the neighbouring country after members of a Somali armed group attacked and killed dozens at a Nairobi shopping mall.

The al-Qaeda-linked al-Shabab group said it raided the Westgate mall, killing at least 67 people in a four-day siege, in revenge for Kenya's military campaign against its fighters inside Somalia.

Al-Shabab repeated its warnings to Kenya on Tuesday of new attacks if it did not pull troops from Somalia.

Earlier, President Kenyatta announced a formal inquiry into the deadly assault.

"We are putting in place a commission of inquiry to see if we could have done things better, to see if there were lapses," Kenyatta said at inter-faith prayers led by leaders from the Muslim, Christian and Hindu communities.

The mall attack bore out widespread fears that Somalia, whose cash-strapped government exerts little control beyond the capital Mogadishu, remained a training ground for armed fighters and a launching pad for attacks beyond its borders.

The Kenyan president said he would not be bullied into withdrawing his soldiers, who are part of an African peacekeeping force.

Al-Shabab warning 

He also took aim at the Somali government, which a source close to the Kenyan presidency said had also recently called for Kenyan troops to leave before withdrawing the demand under pressure from regional leaders.

Kenya's military operations in Somalia

"If their desire is for Kenya to pull out of Somalia, my friends, all they need to do is what they should have done 20 years ago, which is put their house in order," Kenyatta told religious leaders at a multi-faith prayer meeting.

There was no immediate reaction from the Somali government.

But al-Shabab said in a statement that if the Kenyan government's decision was to keep its forces in Somalia, it was an indication that it hadn't yet learned "any valuable lessons" from the Westgate attack.

The group promised even more insecurity, bloodshed and destruction in Kenya.

"Harakat Al-Shabab Al-Mujahideen is fully determined to intensify attacks inside Kenya until the last KDF boots exit Somali soil," the armed group's press office said in a statement.

"If Kenya's political leaders are still persistent in their quest to occupy our Muslim lands and carry out heinous atrocities against our people, then let them know that Kenyans will never find peace and stability in their country."

Source: Al Jazeera and agencies