The al-Qaida-affiliated Somali militant group al-Shabaab has claimed responsibility for the Westgate mall siege in the Kenyan capital Nairobi as an unknown number of militants continue to hold dozens of hostages.

The Somali terrorist group said the attack was retaliation for Kenya's military intervention in Somalia.

More than 39 people have been killed in the attack, many of them children. France said two of its citizens were killed while two Canadians, including a diplomat, have lost their lives.

"Ten hours have passed and the Mujahideen are still strong inside Westgate Mall and still holding their ground. All praise is due to Allah!" the militant outfit wrote on its Twitter account.

The Islamist rebel group, which claims that at least 100 people have been killed in the attack, has ruled out any negotiations with the Kenyan authorities over the standoff.

Another tweet said: "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."

The attackers are armed with automatic weapons and grenades. An injured suspect, thought to be a Kenyan national, has been arrested by the police.

Kenya westgate mall siege

The number of hostages inside the mall remains unclear as they are believed to be in different locations.

"The gunmen have been contained in one location, but there are hostages elsewhere in the vicinity who cannot access the exit," said the Kenya National Disaster Operation Centre.

The rebels inside the mall are believed to have access to the internet, forcing the Kenyan authorities to halt social media updates.

Kenyan President Uhuru Kenyatta said the security forces are continuing to fight the rebels and hoped to crush them.

"We shall hunt down the perpetrators wherever they run to. We shall get to them and we shall punish them for this heinous crime," said Kenyatta.

He said some of his close family members have also been killed in the siege. The Westgate mall is frequented by westerners and high-profile Kenyans.