The bloody siege of an upscale mall by Islamist militants ended Tuesday with five of the attackers dead and 11 taken into custody, amid fears that the death toll of more than 60 civilians could substantially rise when authorities begin searching through the wreckage.

“As a nation, our head is bloodied but unbowed,” Kenyan President Uhuru Kenyatta said in a televised address, declaring three days of mourning. “We have ashamed and defeated our attackers.”

But the assault at the Westgate Premier Shopping Mall could also bolster the image of al-Shabab, the al-Qaeda-linked Somali militia that asserted responsibility for the attack, at a time when it has been weakened by a loss of territory in Somalia and violent infighting. The attackers managed to prolong the standoff in the international spotlight for four days, highlighting their demands for Kenya to withdraw its troops from Somalia. Such a feat, analysts said, could give the militia more credibility in global jihadist circles, attracting more funds and recruits to fuel its ambitions to become a significant international jihadist group.

The storming of the mall Saturday has already been widely praised on jihadist Web sites and social media, according to the SITE Monitoring Service, which tracks statements of extremist groups. It was the deadliest attack in Kenya since the U.S. Embassy bombing in 1998 killed more than 200.

“The Westgate mall attack demonstrates that al-Shabab remains a significant regional threat and presumably will mean more support from radical sympathizers,” said EJ Hogendoorn, Africa deputy program director for the International Crisis Group, a respected think tank. “Whether this will arrest the group’s decline remains to be seen. The group has been weakened, and this is an attempt to reverse that trend.”

Kenyan President Uhuru Kenyatta declares over the four-day-long siege of an upscale mall in the capital of Nairobi. It ended with the deaths of five Islamist militant attackers and 11 in custody. More than 60 people killed in the attack, one the Post's Sudarsan Raghavan says shook the nation. (The Washington Post)

But analysts said a backlash against the group was also possible, especially if Somalis living in Kenya and elsewhere in the region now face greater scrutiny from authorities. The militia’s popularity in Somalia was already waning, and Somali religious leaders denounced it this month as having no place in Islam.

The official death toll of 62 civilians and six members of the security forces was reduced by one civilian Tuesday. But Kenyatta said that three floors of the mall collapsed during the operation and that bodies were trapped under the rubble. The Kenyan Red Cross said as many as 65 civilians reported to have been inside the mall remain missing, suggesting that the death toll could rise sharply in the days ahead.

Kenyatta said he could not confirm reports by Kenya’s foreign minister that American and British citizens were among the heavily armed attackers. But he promised a full accounting of what happened, adding that experts are conducting forensic tests to determine the nationalities of the assailants.

It also remained uncertain whether the security operation was completely over: Government officials said security forces were still combing the mall for any explosives or booby traps left by the militants. Witnesses said some of the attackers may have slipped out in the chaos, and the Kenyan government said 10 suspects were detained at the airport.

Many analysts said that such a well-planned attack could not have taken place without a network of accomplices and financiers inside Kenya.

“These cowards will meet justice as will their accomplices and patrons, wherever they are,” Ken­yatta said.

A war of words online

The announcement that the siege was over came only hours after al-Shabab, whose name in Arabic means “The Youth,” claimed that its fighters had the upper hand. A parallel tussle had unfolded on Twitter between the militants and the government, as each side tried to counter the other’s version of events.

Al-Shabab tweeted earlier Tuesday that it was still holding hostages, who were “looking quite disconcerted but nevertheless, alive.” An earlier al-Shabab tweet said: “Mujahideen are still holding their ground #westgate.”

But Kenyan officials offered a different account, saying they believed that all of the hostages had been released. “We’re very near the end,” the Interior Ministry posted on Twitter at noon.

The conflicting statements underscored the struggle Kenyan security forces faced throughout the crisis. The military deployed helicopters, planes and armored personnel carriers and sought help from U.S., European and Israeli security advisers. Yet the militants remained resilient for four days. The mall, a labyrinthine 350,000-square-foot complex, proved an invaluable asset for the militants, affording them numerous hiding places, food and supplies.

In Somalia, al-Shabab runs a brutal campaign against fellow Muslims, implementing strict Islamic sharia law enforced by public stonings, amputations and beatings for anything it deems un-Islamic, including smoking and the wearing of bras. But witnesses said the militants at the mall targeted non-Muslims and allowed many Muslims to walk out, suggesting they wanted to appeal to radical Muslims and perhaps al-Qaeda’s leadership in Pakistan.

This month, al-Qaeda leader Ayman al-Zawahiri released a document in which he gave guidelines for waging jihad. In it, he instructed fighters not to target Muslims and to take the citizens of nations who have invaded Muslim countries as hostages.

Praise from fellow jihadists

Whatever the motive, the siege was praised widely in online global jihadist forums. According to SITE, on a well-known forum called al-Fida, one extremist wrote: “The operation is a successful blow by the mujahideen brothers from all aspects: the security effort, the planning, the execution and the selection of the target with precision.”

Another lauded the militants as “lions” who had recorded “the most magnificent epics of sacrifice and redemption in the midst of the land of the Crusaders.”

Hogendoorn, of the International Crisis Group, said al-
Shabab had two objectives in storming the mall: to demonstrate that it remains a relevant jihadist force and to trigger a heavy-handed response from Kenyan security forces both within Kenya and in southern Somalia, where Kenyan troops remain active. That could push local clans, he said, to fight against Kenya and other African forces protecting the Somali government, which al-Shabab seeks to oust. In Kenya, such a response could alienate Somalis and other Muslims and drive them to join al-Shabab.

“Kenyans should be concerned about other attacks, but the best response is a measured one,” Hogendoorn said. “Rather than a security clampdown, the better response is to enlist the support of Somalis and the greater Muslim community to counter radicalization and collect, and share, information on jihadi cells.”

Describing the siege as the “blessed Nairobi operation,” al-Shabab spokesman Ali Mahmoud Ragi vowed in an audio speech released by the militia to launch more attacks in Kenya if Kenyan troops do not leave Somalia, according to SITE. Kenyatta and other government officials have said that is not an option.

“If you refuse, you saw what happened, and this is just the beginning,” Ragi said.

Julie Tate in Washington contributed to this report.