Gunmen stormed a shopping centre in the Kenyan capital Nairobi killing at least 30 people including children and sending scores fleeing in panic,in an attack claimed by the Somali Islamist group al-Shabaab.

The Kenyan president Uhuru Kenyatta said that at least 39 people have been killed and more than 150 people injured.

He said that "the despicable perpetrators of this cowardly act hoped tointimidate, divide and cause despondency amongst Kenyans."

Mr Kenyatta said: "we have overcome terrorist attacks before, we will defeat them again."

Shooting continued hours after the initial assault as troops surrounded the Westgate Mall in Nairobi.

Police and soldiers searched the building shop by shop.

A police officer inside the building said that the gunmen were barricaded in a supermarket.

Al-Shabaab is battling Kenya and other African peace keepers in Somalia.

It had repeatedly threatened attacks on Kenya soil if Nairobi does not pull its troops out of Somalia.

The Kenyan presidency said on its Twitter feed that one wounded gunman had been arrested, but had died in hospital.

Tiles at the mall were smeared with blood, bullet casings were strewn on the floor and shop windows were shattered.

A policeman dragged the corpse of a young girl across the floor and laid her on a stretcher.

Two policemen lay on the floor with guns trained on the supermarket entrance.

Some local television stations reported hostages had been taken, but there was no official confirmation.

Al-Shabaab, which Kenya blames for shootings, bombings and grenade attacks against churches and the security forces, had threatened before to strike Westgate.

Westgate is a shopping centre popular with the city's expatriates, as well as other soft targets such as nightclubs and hotels known to be popular with Westerners.

Somali President Hassan Sheikh Mohamud said it was too earlto draw conclusions. "We don't have any proof that the people who did this are Somali," he told Reuters in Washington.

One woman leaving the building told a journalist that one of the attackers had told all Muslims to leave the area.

Survivors told Reuters at least one of the attackers was a woman.

Police helicopters circled above shortly after the initial assault as armed police shouted "Get out! Get out!" and scores of shoppers fled the sand-coloured stone building.

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

Others said they saw about five assailants storm the mall.

The shopping centre includes a number of Israeli-owned businesses, though it was not immediately clear if these had been targeted specifically.

At least four Israeli nationals escaped the assault, one with light wounds.

Some shoppers ran up stairs and escalators and hid around the mall's cinema complex.

Police found another terrified group hiding in a toilet on the first floor.

Some wounded were wheeled out on stretchers and shopping trolleys.

Others walked out, some with bloodied clothing wrapped around wounds.

Dozens of wounded were ferried away by ambulance.

Police cordoned off the roads surrounding the shopping centre in central Nairobi's Westlands neighbourhood.

The US State Department has said that some American citizens have been injured in attacks.

The Irish Department of Foreign Affairs has said that they are not aware of any Irish people being caught up in the shooting in Nairobi.