An unknown number of hostages are being held by gunmen inside a shopping centre in Kenya's capital Nairobi, more than 17 hours after terrorists from the Somali group Al Shabaab launched a deadly attack on the complex.

At least 39 people were killed and more than 150 injured when heavily armed gunmen attacked the city's Westgate mall on Saturday (local time), throwing grenades and shooting shoppers as they went.

The Kenyan government says hostages are being held "in several locations" throughout the complex, but added the upper levels have been secured.

Terrorists are holding an unknown number of people at the mall's Nakumatt supermarket, one of Kenya's biggest chains.

President Uhuru Kenyatta says police are engaged in a "delicate operation", with the top priority being to safeguard the lives of those being held.

The dead includes children and the wounded range in age from two to 78.

Al Shabaab said the attack was retribution for Kenya's operations against the group in Somalia.

France confirmed two of its citizens had been killed, while two Canadians, one of them a diplomat, were also killed, and the US said it had reports of American citizens being among the injured.

Australia's Department of Foreign Affairs says no Australians have been identified among the dead or injured.

One gunman died of his wounds after being arrested by Kenyan security forces, the Kenyan government said on Twitter.

Al Shabaab said on its official Twitter account that the surviving gunmen would not negotiate with security forces.

"The Kenyan (government) is pleading with our Mujahideen inside the mall for negotiations. There will be no negotiations whatsoever at #Westgate," the Al Qaeda-linked militant group said.

Distressed people crying and screaming were being helped out of the Westgate shopping centre all afternoon.Some had been wounded, others clearly in shock. When police and military officers entered the building, gunshots could be heard from outside.Some people who escaped have told how they hid in shops and storerooms to avoid the gunmen.Kenyan police say they have confined the attackers to one section of the centre.

The ABC's Martin Cuddihy reporting from Nairobi this morning

'Execution'-style killings as gunmen shot victims in cold blood

The attack appeared designed to achieve maximum global impact by targeting a place frequented by Westerners as well as Kenyans.

Survivors described how the gunmen stalked through the mall, throwing grenades and killing shoppers as they went.

One survivor, who gave his name as Jay, said he witnessed the gunmen round up shoppers, ask them questions - possibly to find out if they were Muslims - and then shoot them dead.

"They spoke something that seemed like Arabic or Somali," he said. "I saw people being executed after being asked to say something."

Mr Kenyatta said some of his relatives were among the slain.

"I ask God to give you comfort as you confront this tragedy, and I know what you feel, having also lost very close family members in this attack," a sombre Mr Kenyatta said in an address to the nation.

"The despicable perpetrators of this cowardly act hoped to intimidate, divide and cause despondency amongst Kenyans," he added.

"We have overcome terrorist attacks before. We will defeat them again."

Blood on the floor, Red Cross warns casualty list could grow

"We got three bodies from this shop," said volunteer Vipool Shah, 64, standing a dozen metres from the supermarket entrance and pointing to a children's shoe shop where blood lay in pools.

Turning to a nearby burger bar where piped music still played and food lay abandoned, he added: "And a couple of bodies here".

Earlier, the Red Cross warned that the death toll could go up, with more casualties still inside the complex and the fighting ongoing.

"The casualties are many, and that's only what we have on the outside," Kenya Red Cross Society secretary general Abbas Guled said.

"Inside there are even more casualties and shooting is still going on."

Shoppers fled in panic as gunmen stormed mall

Earlier, as the attack unfolded at the mall, police helicopters circled overhead as armed officers shouted "get out, get out", and scores of shoppers fled the building.

"They have seven hostages, confirmed," an officer said as police went shop-by-shop to clear the mall and evacuate terrified people caught up in the attack.

Smoke poured out of one entrance and witnesses said they heard grenade blasts.

Kenya attack: Advice from DFAT

One Australian citizen confirmed killed

Australian embassy working with Kenyan authorities to get more details