At least 22 people have been killed in a suspected terrorist attack in the Kenyan capital, Nairobi, after gunmen opened fire and threw grenades in an upmarket shopping centre.
Witnesses said the men, brandishing AK-47s, told Muslims to leave and shot those they believed were non-Muslims.
"We are treating this as a terrorist attack," said the police chief Benson Kibue, adding that 10 attackers were involved. Police did not say which group was responsible.
"It is a possibility that it is an attack by terrorists, so we are treating the matter very seriously," Mutea Iringo, the principal secretary in the ministry of interior, told Reuters.
The ministry earlier posted warnings to the public on Twitter to avoid the area around the Westgate centre, the most exclusive shopping centre in the city.
Abbas Guled, the secretary general of the Kenya Red Cross Society, said at least 20 people had been killed and another 50 were wounded in the attack at about midday on Saturday.
Elijah Kamau told the Associated Press the gunmen had made the statement about Muslims as they began their attack.
The interior ministry asked local media not to televise the gun battle live because the gunmen were watching the screens in the shopping centre.
Armed police arrived nearly half an hour after the attack began and engaged the gunmen in a shootout. Officers shouted: "Get out, get out", and scores of shoppers fled the building. At least half a dozen were bloodied and helped by first-aiders.
Security guards used shopping trollies to wheel out several wounded children and at least one man.
Rob Vandijk, who works at the Dutch embassy, said he was eating at a restaurant in the shopping centre when attackers lobbed grenades inside the building. He said gunfire then burst out and people screamed as they dropped to the ground.
A former British soldier said: "I personally touched the eyes of four people and they were dead. One of them was a child. It's carnage up there."
Cars were left abandoned outside the centre, which is located in the city's affluent Westlands area and is frequented by expatriates and wealthy Kenyans.
Other witnesses said that they had seen about five armed assailants storm the shopping centre and that the incident appeared to be an attack rather than an armed robbery.
"They don't seem like thugs. This is not a robbery incident," Yukeh Mannasseh told Reuters. "It seems like an attack. The guards who saw them said they were shooting indiscriminately."
Kenya has seen a rise in terrorist attacks and threats in recent years, some of which are believed to be in retaliation for a military crackdown on the Somalian militant group al-Shabaab. The group vowed in 2011 to carry out a large-scale attack in Nairobi in retaliation for Kenya sending troops into Somalia to fight them.
The attacks often involve gunmen armed with automatic weapons and grenades, and their targets include bars, nightclubs and restaurants in various parts of the country. A suspected al-Shabaab attack in January left five people dead and three injured at a restaurant in the eastern city of Garissa. In August last year one person was killed and six injured in the Eastleigh area of Nairobi on the eve of a visit by Hillary Clinton, the then US secretary of state.
Last month 18 of the 19 US embassies and consulates across the Middle East and Africa were closed after a message between al-Qaida officials about plans for a major terrorist attack was intercepted.
UPDATE via AFP (3:41 p.m. EST): Masked gunmen stormed a packed upmarket shopping mall in Nairobi on Saturday, killing 30 people and wounding dozens more in a massacre claimed by Somalia's Al Qaeda-inspired Shebab rebels.
The rebels said the carnage was in direct retaliation for Kenya's military intervention in Somalia, where African Union troops are battling the Islamists.
"The Mujahideen entered #Westgate Mall today at around noon and are still inside the mall, fighting the #Kenyan Kuffar (infidels) inside their own turf," the group said on Twitter.
A security source said police and soldiers had finally "pinned down" the gunmen after hours of fierce gunbattles and painstaking evacuations, with police going shop to shop to secure the Westgate shopping mall.
"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.
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 Shebab tweet said the group's warnings over Kenya's military presence in Somalia had been ignored.
Shebab "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.
Kenyan forces entered Somalia two years ago to fight the Shebab, and remain in the country as part of an African Union force that is supporting Somalia's internationally backed government.
An eyewitness told AFP that he heard the gunmen speaking Arabic or Somali and saw the group executing shoppers, in what was the worst attack in Nairobi since an Al-Qaeda bombing at the US embassy killed more than 200 in 1998.
"The death toll is now standing at 30. This includes those who have died at the scene and at the hospital," a senior police official told reporters. The Red Cross confirmed the figure and said another 60 had been wounded in the attack.
Americans were reportedly among those injured, the United States said as it condemned the "senseless act of violence".
"We have reports of American citizens injured in the attack, and the US embassy is actively reaching out to provide assistance," State Department spokeswoman Marie Harf said without elaborating, citing privacy concerns.
Police at the scene said a suspect wounded in the firefight had been detained and taken to hospital under armed guard.
"We have reports there were up to 10 or so attackers and they appeared to be wearing a similar outfit, and others covered their faces," a police official said. "The pattern of the attack and the way they were speaking to their targets clearly point to a well-planned attack by a terror gang."
Kenyan troops could be seen moving around and inside the shopping centre while special forces had joined the operation. An AFP reporter said she saw at least 20 people rescued from a toy shop. Dozens of wounded, some of them bleeding children, were taken away from the mall on stretchers.
A shop manager who managed to escape said at one point "it seemed that the shooters had taken control of all the mall".
"They spoke something that seemed like Arabic or Somali," said a man who escaped the mall and gave his name only as Jay. "I saw people being executed after being asked to say something."
Shocked people of all races 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 lied down. I saw two people who were lying down and bleeding, I think they were hit by bullets," he said.
An eyewitness who survived the assault 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.
Vehicles riddled with bullet holes were left abandoned in front of the mall as the Red Cross appealed for blood donations and police instructed Nairobi residents 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 opened in 2007 and has long been considered a potential terror target.
The mall 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.
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."
Watch video from the scene, embedded below via the Associated Press: