Shocked people could be seen running away from the Westgate centre clutching children while others crawled along walls to avoid stray bullets.
Kenneth Kerich, who was shopping when the attack happened, described scenes of panic.
“I suddenly heard gunshots and saw everyone running around so we lay down. I saw two people who were lying down and bleeding, I think they were hit by bullets,” he said.
“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.”
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,” mall employee Sudjar Singh told AFP.
“I saw a young boy carried out on a shopping cart, it looked like he was about five or six. It looked like he was gone, he was not moving or making any noise.”
Vehicles riddled with bullet holes were left abandoned in front of the mall as the Red Cross appealed for blood donations and police instructed residents of the Westlands neighbourhood to stay away.
The four-storey mall, which has several Israeli-owned businesses, is a hub for Nairobi-based Westerners and one of the foremost symbols of Kenya’s affluent classes. It has long been considered a potential terror target. It opened in 2007 and has restaurants, cafes, banks, a large supermarket and a cinema.
It is popular with the large expatriate community living in the residential neighbourhoods around it, including with foreign staff from the United Nations, which has its third largest global centre nearby.
Security agencies have regularly included the Westgate shopping centre on lists of sites they feared could be targeted by Al Qaeda-linked groups.
The Somali insurgents from the Shabaab group have repeatedly threatened to strike at the heart of Kenya in retaliation for Nairobi’s military involvement alongside the government they are trying to overthrow.
UN Secretary-General Ban Ki-moon is following the attack “closely and with alarm”, a statement from his office said.
British Foreign Secretary William Hague said on Twitter that his country was “in close touch with Kenyan authorities about the attack in Nairobi. Our urgent priority is the welfare of UK nationals.”