One sharp-eyed shopper at the mall saw the Arab who was with the Somalian al Shabaab terrorist group, change his clothes and then mingle with the crowd that was rescued by the police.
"The attackers have been isolated and are pinned down in an area on one of the floors. The rest of the mall seems to be secure," the source told AFP at the scene.
Police at the scene said a suspect wounded in the firefight had been detained and taken to hospital under armed guard.
Senior police sources described the attackers as a well-organised "terror gang" numbering around 10. The mall, popular with wealthy Kenyans and expatriates and part Israeli-owned, was packed with around 1,000 shoppers when it was besieged at midday.
The Shabaab tweet said the group's warnings over Kenya's military presence in Somalia had been ignored.
Shabaab "on numerous occasions warned the Kenyan government that failure to remove its forces from Somalia would have severe consequences," it said.
"The Kenyan government, however, turned a deaf ear to our repeated warnings and continued to massacre innocent Muslims in Somalia #Westgate," the group tweeted via its @HSM_Press account.
"The attack at #WestgateMall is just a very tiny fraction of what Muslims in Somalia experience at the hands of Kenyan invaders," it said.........