Early Sunday morning, 12 hours after the attack began, gunmen remained holed up inside the mall with an unknown number of hostages. President Uhuru Kenyatta called the security operation underway "delicate" and said a top priority was to safeguard hostages.
As the attack began shortly after noon Saturday, the al-Qaida-linked gunmen asked the victims they had cornered if they were Muslim: Those who answered yes were free to go, several witnesses said. The non-Muslims were not.
Somalia's Islamic extremist group al-Shabab claimed responsibility and said the attack was retribution for Kenyan forces' push into Somalia in 2011.
Al-Shabab said on its Twitter feed that Kenyan security officials were trying to open negotiations. "There will be no negotiations whatsoever," al-Shabab tweeted.
As night fell in Kenya's capital, two contingents of army special forces troops moved inside the mall.
Police and military surrounded the shopping complex as helicopters buzzed overhead. An Associated Press reporter said he saw a wounded Kenyan soldier put into an ambulance at nightfall, an indication, perhaps, of a continuing shootout inside.
Witnesses said at least five gunmen — including at least one woman — first attacked an outdoor cafe at Nairobi's Westgate Mall, a shiny, new shopping center that includes Nike, Adidas and Bose stores. The mall's ownership is Israeli, and security experts have long said the structure made an attractive terrorist target.
Shoppers fled in any direction that might be safe: into back corners of stores, back service hallways and bank vaults. Over the next several hours, pockets of people trickled out of the mall as undercover police moved in. Some of the wounded were trundled out in shopping carts.
"We started by hearing gunshots downstairs and outside. Later we heard them come inside. We took cover. Then we saw two gunmen wearing black turbans. I saw them shoot," said Patrick Kuria, an employee at Artcaffe, the restaurant with shady outdoor seating.
Frank Mugungu, an off-duty army sergeant major, said he saw four male attackers and one female attacker. "One was Somali," he said.
Al-Shabab, on its Twitter feed, said that it has many times warned Kenya's government that failure to remove its forces from Somalia "would have severe consequences." The group claimed that its gunmen had killed 100 people, but its assertions are often exaggerated.
"The attack at WestgateMall is just a very tiny fraction of what Muslims in Somalia experience at the hands of Kenyan invaders," al-Shabab said. 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 Westgate." Al-Shabab's Twitter account was suspended shortly after its claim of responsibility and threats against Kenya. Twitter's terms of service forbids making threats.
Al-Shabab threatened in late 2011 to unleash a large-scale attack in Nairobi. Kenya has seen a regular spate of grenade attacks since then but never such a large terrorist assault.
Nairobi's mortuary superintendent, Sammy Nyongesa Jacob, said Africans, Asians and Caucasians were among the bodies brought to the mortuary.
The U.S. State Department condemned "this senseless act of violence that has resulted in death and injury for many innocent men, women, and children." In a separate statement, a White House spokeswoman said some staff at the U.S. Embassy in Kenya have been "tragically affected" by the attack. No other information was provided.