Eleven people have died in a gun battle inside a Nairobi shopping centre, says a senior Kenyan security official.
Mutea Iringo blamed “armed criminals” and said police were in control of a “very serious situation”. Officers are going shop to shop to secure the area. The Kenyan Red Cross says 30 died.
Eyewitnesses saw armed men in black entering the Westgate shopping centre on Saturday afternoon.
The Somali militant group al-Shabab had threatened to strike the centre.
Al-Shabab has carried out a string of attacks in Kenya since 2011, when Kenyan troops moved into southern Somalia to fight the militants there.
No group has said it carried out the attack. Some eyewitnesses told AFP news agency they had heard the gunmen speaking Arabic or Somali.
Other witnesses said Muslims were told to leave and that non-Muslims would be targeted.
“They came and said: ‘If you are Muslim, stand up. We’ve come to rescue you,” said Elijah Lamau.
He said the Muslims left with their hands up, and then the gunmen shot two people.
At the scene
The BBC has received the following emails from someone who was hiding at the scene
11:33: Am hiding in a store, my next person (is) an Indian shot. Severe shooting going on within the premises. I left (a) parcel in my car mid of the road, praying.
12:28: Thugs inside, we don’t know when the police will rescue us, all over TVs and radio, we are warned not to move, am in a dark store, more police coming.
12:38: I don’t even know if I stopped engine of car. Nobody is going out, only police. Praying they ditch thugs out. It is a big shopping mall, now knowing where thugs are is hard. Getting out of here is a mystery. My next person (is) an Indian shot and bleeding.
The attackers entered the Westgate centre at about 12:00 local time (09:00 GMT), throwing grenades and firing automatic weapons.
Dozens of shoppers fled, many were trapped inside. Some reports spoke of hostages but this is unconfirmed.
Arjen Westra, who was drinking coffee at the time of the attack, told the BBC he thought the cafe he was in was being targeted by the gunmen.
“I could hear the gunfire moving towards the main entrance of the shopping mall, so some people ran out of our cafe in a kind of panic, and quite a number just fell down as flat as possible on the ground.”
Mr Iringo, permanent secretary in the Internal Security Ministry, said special forces were now “evacuating civilians and searching for the criminals”.
Nairobi police chief Benson Kibue initially said the gunmen had been trying to rob a shop, but later called it “a terrorist attack”.
The BBC’s Anne Soy, who is at the scene, said there were reports one of the gunmen has been shot dead.
Some of the attackers were reportedly dressed in hijabs, and it is unclear whether they were men or women, our correspondent says.
Security guards used shopping trolleys to wheel out several wounded children and at least one man.
“The gunmen tried to fire at my head but missed. There are definitely many casualties,” Sudjar Singh, who works at the shopping centre, told AFP.
“I saw three of the attackers dressed in black and with covered faces and they were carrying heavy rifles,” said another witness.
One Nairobi resident, Anupa, who lives near the scene, told the BBC: “I heard the exchange of fire when it happened, and I heard what I thought was a grenade, but I didn’t go outside. The whole area is cordoned off.”
The Westgate centre is often frequented by wealthy Kenyans and expatriates. Police have urged residents to stay away from the area.