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 has said it carried out the attack.
On its Twitter feed, the al-Qaeda-linked group said it confirmed it was behind what it called the "Westgate spectacle".
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.
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.
The US state department says it has reports that American citizens were injured in what it called "a senseless act of violence".
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.