Gunmen stormed a popular high-end shopping mall in the Kenyan capital Saturday afternoon, lobbing grenades and firing weapons in an attack that left at least 39 people dead and more than 150 injured, Kenyan officials said.

As of early Sunday, more than 12 hours after the initial assault, the attackers, strapped with grenades and wielding machine guns and AK-47 rifles, remained holed up with scores of hostages in a supermarket within the Westgate Premier Shopping Mall, exchanging gunfire with Kenyan police and soldiers.

Al-Shabab, a Somali militia linked to al-Qaeda, asserted responsibility for the assault in numerous tweets using its official Twitter handle, @HSM_Press. The militia said it was retaliating for Kenya sending troops to fight in neighboring Somalia, where it remains a key military actor. “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,” the militia said in one tweet.

The dead and injured included young and old, Kenyans and foreigners, according to witnesses and a U.S. State Department official familiar with the situation, who spoke on the condition of anonymity because the official was not authorized to speak publicly. No Americans were believed to be among the dead, the official said. Four U.S. citizens were reported injured, the Associated Press said.

Several children were reported killed or injured.

Annamaria Watrin, an American aid worker from Minnesota, said a friend and his 13-year-old daughter had gone to the mall for a birthday party. “As they went to park their car, she saw five gunmen pop out. They shot her dad. He died,” Watrin said. The girl was injured. Watrin said the girl spent a couple hours huddled in the car before Kenyan security agents could evacuate her into an ambulance.

The assault was the deadliest terrorist attack in this East Africa nation since al-Qaeda operatives staged twin bombings of the U.S. embassies in Nairobi and Dar es Salaam, Tanzania, in 1998, killing more than 200 people in Kenya alone. Al-Shabab has staged numerous smaller attacks in the country since the government sent troops to Somalia in October 2011 to fight the militia. Most of those assaults targeted bus stations and churches, but never areas frequented by Westerners and wealthy Kenyans. The tourism industry is Kenya’s second-largest source of foreign exchange, and dozens of Western aid agencies and businesses are based in the country.

Now, Saturday’s attack has appeared to usher in a new war on its soil for Kenya, long a bulwark of stability in the region and a key U.S. ally in the fight against terrorism.

The militia also orchestrated twin bombings in Kampala, Uganda, during the World Cup in July 2010, killing more than 70 people. That attack, the militia said, was in retaliation for the participation of Ugandan soldiers in an African force sent to protect Somalia’s government.

In a nationally televised address, President Uhuru Kenyatta vowed to hunt down the perpetrators.

“We have overcome terrorist attacks before. We will defeat them again,” Kenyatta said, adding that some of his close relatives were among the dead.

Steep rises in fatalities

The scene at the mall Saturday afternoon was chaotic.

“We have taken so many to the hospital,” said Zulekha Khalid, a Kenyan Red Cross worker taking cover behind a police truck as a barrage of bullets was fired from the direction of the mall.

The Kenyan Red Cross said at least 30 people were dead and more than 60 were injured in the attack but expected the tolls to rise. Ken­yatta said the death toll had reached 39 with more than 150 injured.

The presidential office said in a tweet that a wounded attacker had been taken into custody and was hospitalized but died of his injuries. Police had earlier characterized the assault as a robbery gone wrong, but senior Kenyan officials later said it was probably a terrorist attack.

Some witnesses and security officials said the assailants, dressed in dark clothes, numbered no more than five, while others said there were as many 10 or 15. Witnesses said one was a woman who wore a hijab, attire favored by conservative Muslim women.

According to several accounts, including one relayed to a Washington Post reporter, the attackers had ordered Muslims to leave the premises in an apparent attempt to target non-Muslims.

By early evening, the attackers were on an upper floor of the mall, holding hostages, according to police officials and security officers at the scene. Scores of people remained inside, huddling in stores, banks, even closets. Outside, their relatives frantically sent them text messages, comforting them as best as they could.

Earlier, many had filtered out with the help of security personnel, their faces revealing the anguish of their ordeal. Some collapsed on the asphalt, while others had to be carried out, covered in blood from bullet wounds. Ambulances waited outside to ferry the wounded to hospitals.

Outside the mall entrance, two bodies lay on the ground, next to cars peppered with bullet holes.

Close encounters

Elizabeth Muthona, an employee of Nakumatt, a supermarket inside the mall, watched solemnly Saturday afternoon as more people fled the area, some with bleeding wounds, some carrying their kids in their arms. She, too, had fled moments earlier.

For several hours, she hid inside a cardboard box, holding her breath as gunmen walked through the store. “I heard the gunshots, and we started running into the store, and we hid in a carton box,” said Muthona, in a quiet and shaking voice. “The gunmen came inside the store, but they didn’t find us.” She paused, then added, “I didn’t expect this to happen. There was so much security inside the mall.”

Frank Musungu, an army warrant officer who was shopping in the mall, said he and another security officer tried to assist someone. But the person was one of the assailants. “He stood up and shot my friend,” recalled Musungu, who took cover behind a wall. “I pulled him towards me and carried him to an ambulance.” Musungu said one attacker wore a white turban, but others wore civilian clothes, “dressed like me and you.”

In Washington, Secretary of State John F. Kerry issued a statement saying that the attack was “a heartbreaking reminder that there exists unspeakable evil in our world which can destroy life in a senseless instant.” His statement said that the wife of a U.S. Agency for International Development worker was among those killed.

Many middle-class Kenyans and expatriates have long voiced concern about a possible attack on Westgate and other upscale shopping centers and restaurants in Nairobi. Guards at the malls check vehicles for explosives and use hand-held metal scans on shoppers, but they are mostly unarmed, incapable of responding to a heavily armed attack.

Al-Shabab said in tweets that “what Kenyans are witnessing at Westgate is retributive justice for crimes committed by their military.”

The militia said it was in contact with the assailants inside the mall and ruled out negotiations for the release of the hostages.

Matea Gold contributed to this report from Washington.