Several attackers and trapped civilians were believed to still be inside the large four-storey shopping centre more than two hours after the attack began, and heavy fire was heard as police units moved in.
Police and ambulances surrounded the Westgate mall, which is popular with wealthy Kenyans and expatriates and would have been packed with families on a sunny weekend day, AFP reporters and witnesses said.
Terrified people -- black, white and Indian -- could be seen running away from the compound clutching children while others crawled along walls to avoid stray bullets.
"I suddenly heard gunshots and saw everyone running around so we lied down. I saw two people who were lying down and bleeding, I think they were hit by bullets," he said.
More From This Section
"Initially we thought it is police fighting thugs. But we could not leave until when officers walked in, shot in the air and told us to get out."
The motive of the attack was not immediately clear, but Kenyan media said the attackers, who witnesses said were black-clad and masked, may have been either armed robbers or "terrorists".
An eyewitness who survived the assault by gunmen said he saw the body of a child being wheeled out of the mall.
"The gunmen tried to fire at my head but missed. At least 50 people were shot. There are definitely many casualties," a mall employee, Sudjar Singh, told AFP.
"I saw a young boy carried out on a shopping cart, it looked like he was about 5 or 6. It looked like he was gone, he was not moving or making any noise."
"There's an incident at Westgate and we're urging the public to keep off the area," Inspector General of Police David Kimaiyo said.
"Our officers are on the ground carrying out an evacuation of those inside as they search for the attackers who are said to be inside," he said.
"We have managed to evacuate some people to safety. We urge Kenyans to avoid the area as we pursue the thugs," Kenya's Interior Ministry said on Twitter.