NAIROBI —
Kenya's president says at least 39 people have been killed and more than 150 wounded following an attack by heavily-armed gunmen in an upscale shopping mall in Nairobi.

Survivors say gunmen fired indiscriminately at crowds of shoppers and threw grenades as they moved into the Westgate Mall, a popular gathering place for shopping and dining in the capital.

Injured woman is helped out of Westgate Shopping Centre where gunmen went on shooting and grenade-throwing spree, Nairobi Sept. 21, 2013.

Authorities were still working early Sunday to apprehend gunmen, and that security forces have surrounded the attackers who have been holed up inside the 5-story structure since early Saturday and are believed to hold hostages.

While dozens of people have been rescued and police and security forces have said that they have regained control of the mall, rescue workers have said some shoppers are still holed up inside.

The fate of the attackers is unclear.

Militant group al-Shabab is claiming responsibility for the attack, in which some children were injured.

The Somalia-based armed extremists claimed in messages posted on Twitter that its "mujahideen" carried out the assault in retaliation for Kenya's military intervention in Somalia. The extremist group also said it had warned that Kenya's military presence in Somalia would bring "severe consequences," and that bloodshed at the mall is only a "very tiny fraction" of the violence that has been inflicted on Muslims in their own country.

In an audio message posted on a pro-al-Shabab website, the group urged Kenyan citizens to pressure their government to remove its forces from Somalia if they want to see an end to this sort of attack.

Kenyatta address

Seeking to reassure the nation, President Uhuru Kenyatta spoke just hours after the morning attack, condemning what he called the cowardly act and praising Kenyans for their solidarity in the face of the terrorist threat.

Sending condolences to those who lost family members and wishing the injured a quick recovery, he said that security forces are working to secure the mall and save lives.

“Our security forces are conducting a multi-agency response to this attack as we speak, and we are in the process of neutralizing the attackers and securing the mall," he said. “It is a very delicate operation as our top priority remains to safeguard the lives of innocent people held up in this unfortunate incident.”

The president also vowed to capture and prosecute the perpetrators, insisting his government stands ready to defend the country from within and abroad. Kenyan forces entered Somalia two years ago after accusing al-Shabab of a series of kidnappings and attacks in Kenya.

"Terrorism in and of itself is the philosophy of cowards," he said. "The way we lead our lives in freedom, unity and consideration for each other represents our victory over those who wish us ill."

Security response

Addressing reporters in Nairobi, Interior Ministry Secretary Mutea Iringo said security forces gained access to the mall several hours after the attack began late Saturday morning.

He asked for the public to give security forces the space required to conduct a thorough investigation.

“We request the members of public to keep off the scene at the moment, to enable the police to deal with the situation without any hindrance," he said. "I wish once again to reassure Kenyans the government will not relent on the war against armed criminals.”

The mall was packed with hundreds of shoppers when the attack began, and many fled in the first moments after police moved in. Others were pinned down by gunfire and were unable to leave the mall for hours.

Some officials said they believe the attackers may be hiding inside the mall, but others expressed concern that some of the 10 or more gunmen who staged the assault escaped by blending into the masses of people dashing out of the building, the first wave of whom were not screened by police before leaving the area.

Hezron Karanja, a father of two who was trapped inside the mall for more than three hours, said he heard the attackers speaking in a language he did not understand.

“We have gone to do our banking inside Nakumatt hall, and then all of a sudden we heard gunshots, and all of us had to lie down," he said. "That was around between 12:30 and up to now. We have been holed [up] inside there and hearing certain language that we couldn’t understand, [from] people who were giving commands and orders.”

Swahili and English are Kenya's official languages, but many people also speak other indigenous languages and dialects.

Armed robberies common

The attack shocked people throughout Nairobi and prompted many shopping centers in other parts of the country to close early Saturday as a precaution.

Armed robberies are common in the capital, but the city has also faced a series of grenade attacks since its troops crossed into Somalia to fight the militant group al-Shabab in 2011.

The Westgate Mall has been identified as one the key places gunmen or terrorist groups could target since the mall is frequented by Westerners.

Canada and France each say two of their own citizens were killed in the attack, and U.S. State Department spokeswoman Marie Harf said there are reports of Americans injured in the attack, but no further details were immediately available. U.S. Secretary of State John Kerry condemned the attack and said the United States has offered Kenya's government its full support to help bring the perpetrators of the attack to justice.

Harf condemned what she called a "senseless act of violence."

United Nations Secretary-General Ban Ki-moon expressed alarm about the attack and spoke to the Kenyan president about it.