Nairobi, Kenya (CNN) -- Armed gunmen faced off with Kenyan police and soldiers inside an upscale Nairobi shopping mall early Sunday, hours after brazenly gunning down shoppers, diners and more.

Around 2:30 a.m. Sunday (6:30 p.m. ET Saturday) -- an hour after reporting five "visibly shaken" hostages had been released -- Kenya's National Disaster Operation Centre cryptically tweeted "major operations underway." What that meant was a mystery, and it didn't quell fears about what has happened or might happen to an unknown number of civilians who were still unaccounted for inside.

The same agency offered an update about three hours later stating that hostages were being held "in several locations," adding there was "no communications as yet." By then, government authorities had secured the mall's upper levels, though it was not known where the attackers -- and the threat -- remained.

Hours earlier, Kenya's president announced that 39 people, including some of his close relatives, were confirmed dead in the attack. 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."

Q and A: Al-Shabaab grew amid Somalia's lawlessness

Al-Shabaab, an al Qaeda-linked militant group based in Somalia with ties to Nairobi's Eastleigh district and whose most recent attack of this scale came July 2010 in Uganda's capital, 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 its targets were people who didn't believe in their extreme form of Islam.

"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."

CNN security analyst: Kenya, Westerners high on Al-Shabaab's list

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 that started around noon shattered any sense of normalcy among those picking up groceries, savoring lunch and browsing through the racks at stores.

Uche Kaigwa-Okoye was sipping 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.

Gripped by fear: Not seeing attackers was part of the terror

Some went outside, only to turn around and go back into the four-story mall after realizing bullets were flying there as well. Kaigwa-Okoye was among them, joining about 20 people who took shelter for about five hours in a women's 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.

Sara Head, a Washington resident, experienced similar horror in the mall's parking garage. As her car pulled up, she and others heard gunfire -- prompting them to crawl underneath and sneak behind cars before getting into a stairwell. She had company there, including two people bleeding from gunshot wounds.

Eventually, the stairwell lights went back on and the door to a nearby supermarket opened, so they dashed through and past a nearby loading dock to safety.

"There was blood throughout the supermarket," 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, the sight of Kenyan soldiers in military fatigues crawling under cars with their guns cocked made clear that the once shiny, pristine Westgate mall had become a war zone. The whirr of surveillance helicopters overhead drove home the point.

Police took those leaving the building in a straight line, arms raised in the air. They were all taken to a secluded place for vetting to ensure they were not attackers.

The military asked media not to televise anything live because the gunmen might be watching screens inside the mall and therefore take cues on their movement.

And everyone else, except for authorities, was urged to stay away as roads and nearby locales, including another shopping center, was closed down.

World leaders condemn terror attack at Kenya mall, pledge support

The U.N. Security Council condemned the attack "in the strongest possible terms," voicing solidarity with Kenya while calling terrorism "one of the most serious threats to international peace and security."

Most of the casualties are Kenyan, authorities said. But the mall is popular with expatriates and foreign nationals, who are among those killed and injured.

That includes two dead French nationals, their government said. Likewise, two Canadians -- one of them a diplomat -- died in the attack, according to Prime Minister Stephen Harper's office.

U.S. Secretary of State John Kerry said there were several Americans among the injured but none among the dead, though the wife of a foreign national working for the U.S. Agency for International Development was killed.

"As we prepare to bring the world's leaders at the United Nations next week," Kerry said in reference to the upcoming U.N. General Assembly, "we are reminded again in tragedy of our common humanity."

CNN's Faith Karimi and Greg Botelho reported and wrote from Atlanta; Lillian Lesposo reported from Nairobi. CNN's Michael Martinez, Chelsea Carter, Tim Lister, Nima Elbagir, Boriana Milanova, Jamie Crawford, Stefan Simons, Karen Smith and Azadeh Ansari contributed to this report.