Nairobi, Kenya (CNN) -- Armed gunmen waged a tense standoff with Kenyan police and soldiers inside an upscale Nairobi shopping mall early Sunday, hours after brazenly gunning down shoppers, diners and more.
Bodies still littered the lobby and ground floor of the Westgate Mall more than 10 hours after the attack began, according to the Kenya National Disaster Operation Centre. And with gunmen dug in and an unknown number of innocent civilians -- perhaps dead or being held hostage -- still unaccounted for, there are fears the carnage will get even worse.
There were 39 confirmed dead as of around midnight Saturday, according to Kenya's president, who added his close relatives are among those killed. Two gunmen, including one who was detained after being shot, are also dead.
Francis Kimenia, secretary to the Cabinet, tweeted another 293 people got treatment at three area hospitals, which "are appealing for more blood." The wounded range in age from 2 to 78, the disaster operations center said, urging people to "remember them in your prayers."
Al-Shabaab, an al-Qaeda-linked militant group based in Somalia, claimed responsibility for the carnage and vowed not to negotiate with Kenyan authorities. It claimed that "all Muslims" were escorted from the mall before the attack -- suggesting that its targets were people who didn't believe in their extreme form of Islam.
Q and A: Al-Shabaab grew amid Somalia's lawlessness
"The Mujahideen are still strong inside #Westgate Mall and still holding their ground," the group said late Saturday via Twitter. "All praise is due to Allah!"
Kenyan authorities, though, insist they have the upper hand, where it's now early Sunday morning. The last few hours of Saturday and the first few of Sunday, in Kenya, were largely quiet outside the mall except for movement
Police tweeted that the attackers "have been isolated and pinned down in a room by security forces." And Joseph Ole Lenku, the national government's cabinet secretary for interior and coordination, hinted that the worst should be over.
"Our security forces have taken control of the situation," Lenku said.
"Attackers of Westgate shopping mall have been isolated and pinned down in a room by security forces in the ongoing operation," the national police said on Twitter.
Kenya's president, Uhuru Kenyatta, blasted "the despicable perpetrators of this cowardly act (who) hoped to intimidate, divide and cause despondency among Kenyans and would like to (create) a closed, fearful and fractured society."
Kenya is no stranger to terrorism, including a 1998 bombing at the U.S. Embassy in Nairobi that left 213 dead and other attacks before and since tied to al Qaeda and related groups.
In a televised speech late Saturday, Kenyatta said his nation has "overcome" such attacks before, refusing to budge from its values or relinquish his security. And it will do so again, he promised.
"We shall hunt down the perpetrators wherever they run to," the president said. "We shall get them, and we shall punish them for this heinous crime.
Midday peace shattered by gunfire, blasts
"Westgate Mall lends itself a serene and safe environment away from the city centre," the mall's official website states.
That may have been true before -- while there had been warnings, the high-end mall filled with more than 80 stores and restaurants had never been targeted. But it couldn't have been further from the truth Saturday.
Rattles of gunshots beginning around noon shattered any sense of peace or normalcy among those picking up groceries, savoring their lunch and browsing through the racks at stores.
Not seeing the attackers was part of the terror
Uche Kaigwa-Okoye was sipping his coffee when he heard what first sounded like a fallen table, then the continuing rat-a-tat of gunfire. As the gunshots became louder, people began screaming and running for the exits.
Some ran outside, only to turn around and headed back into the four-story mall when they realized bullets were flying there as well. Kaigwa-Okoye was among them, joining about 20 people who took shelter in a bathroom cubicle.
"They had grenades, and it was really, really loud," he told CNN, adding that he noticed tear gas in the corridors as well. "All of us felt like they were close."
As people texted family and friends outside the mall, word spread that nobody could be trusted -- and, even if the good guys could be sorted from the bad guys, the barrage of intermittent gunfire made any escape seem futile at times.
Sara Head, a Washington resident, experienced much of the same horror in the mall's parking garage. As her car pulled up, she and others heard the rattle of gunfire -- prompting them to crawl underneath and sneak behind cars before getting into a stairwell. She had company, including two people bleeding from gunshot wounds.
Eventually, the stairwell lights turned back on and the door to a nearby supermarket opened, so they dashed through the market and a nearby loading dock to safety.
"There was blood throughout the supermarket as we exited," Head recalled. "... It wasn't clear if it was OK to exit. I was short of sheep following."
Soldiers crawl under cars, copters fly overhead
By then it was clear that the once shiny, pristine Westgate mall had become a war zone.
That was shown as Kenyan soldiers in military fatigues, their guns cocked, crawled under cars to get closer to the mall, guns cocked.
Surveillance helicopters flew overhead.
Police took those rescued from the building to a secluded place for vetting to ensure they were not attackers. They streamed away from the mall in a straight line, arms raised up in the air.
The military asked local media not to televise anything live because the gunmen are watching the screens in the mall, which is popular with expatriates and the wealthy.
"We urge Kenyans to keep off Westgate mall, adjacent roads and its environs until further notice," the interior ministry said in a statement.
An unknown number of Americans were among those injured, but the majority of casualties are Kenyan, authorities said.
CNN's Faith Karimi and Greg Botelho reported and wrote from Atlanta; Lillian Lesposo reported from Nairobi. CNN's Michael Martinez, Chelsea Carter, Nima Elbagir, Boriana Milanova, Jamie Crawford, Stefan Simons, Karen Smith and Azadeh Ansari contributed to this report.