The building's blueprints were studied, down to the ventilation ducts. The attack was rehearsed and the team dispatched, slipping undetected through Kenya's porous borders, often patrolled by underpaid - and deeply corrupt - border guards.
A day or two before the attack, powerful belt-fed machine guns were secretly stashed in a shop in the mall with the help of a colluding employee, officials say. At least one militant had packed a change of clothes so he could slip out with fleeing civilians after the killings were done.
That is the picture emerging from American security officials of the massacre at the Westgate mall, which killed scores of people over the weekend. After a four-day standoff, President Uhuru Kenyatta of Kenya claimed Tuesday to have finally "ashamed and defeated our attackers," declaring that the last militants still holed up inside the mall had been killed, though the bodies of many civilians, perhaps dozens, have yet to be recovered.
Kenyatta contended that "intelligence reports had suggested that a British woman and two or three American citizens may have been involved," but said that he could not confirm those reports. American officials said that they had not determined the identities of the attackers and were awaiting DNA tests and footage from the mall's security cameras, but that they did know the massacre was meticulously planned to draw "maximum exposure."
"They had people in there, they had stuff inside there," said an American security official who asked not to be identified because he was not authorized to speak publicly. "This was all ready to go when the shooters walked in."
Kenya is now entering an official three-day mourning period to mark one of the most unsettling episodes in its recent history. The authorities here, in a country widely perceived as an oasis of peace and prosperity in a troubled region, are struggling to answer how 10 to 15 Islamist extremists could lay siege to a shopping mall, killing more than 60 civilians with military-grade weaponry, then hold off Kenyan security forces for days.
On multiple occasions, the Kenyan government has said that the mall was under its control, only to have fighting burst out again. Earlier Tuesday, al-Shabab, the Somali Islamist group that has taken responsibility for the attack, bragged in a Twitter message that its fighters were "still holding their ground."
Western security officials fear that several fighters slipped out of the mall during the mayhem of the attack, dropping their guns and disguising themselves as civilians, an account echoed by some witnesses.
And there could be more bodies. The Kenya Red Cross said Tuesday that more than 50 people were still missing.
The attack may have some unexpected connections to the recent assassination of Omar Hammami, an al-Shabab fighter who grew up in Alabama and became a phantom-like figure across the Somali deserts, known by his nom de guerre: Abu Mansoor Al-Amriki, "the American." Hammami was gunned down by another wing of al-Shabab less than two weeks ago.
One reason for the rift was Hammami's complaints that al-Shabab had become too brutal toward fellow Muslims under the leadership of the group's emir, Ahmed Abdi Godane. That brutality, Hammami said, was the reason al-Shabab had become so unpopular in Somalia and lost so much territory recently.
Stig Jarle Hansen, a Norwegian researcher who has published a book on al-Shabab, said this rift might explain the fact that the militants in the Nairobi mall deliberately spared the lives of many Muslims. In the past, al-Shabab has killed countless Muslims in Somalia with suicide bombs and buried Muslim girls up to their necks in sand and stoned them.
Some Muslims were indeed killed in the mall. But many survivors of the attack said the militants questioned people at gunpoint about their religion, ruthlessly sorting out non-Muslims for execution. Aleem Manji, a Kenyan radio announcer, remembered that as he uttered an Islamic prayer to save his life, the gunman threatening to kill him spoke fluent English.
His accent was "light," Manji recalled, saying that it definitely was not Kenyan.
American officials - who said they based their reconstruction of the plot on intelligence reports, witness statements and intercepted electronic messages - say that al-Shabab may have recruited English speakers from the United States and possibly other Western countries so that they would be able to operate effectively in Kenya, where English, along with Swahili, is the national language. Some survivors, including a newspaper vendor who watched one militant mercilessly shoot a toddler in the legs, said other gunmen were young and either Somali or Arab.
American officials said the militants must have had a back office in Kenya, a safe house to finalize their plot and store their guns. Witnesses said that several militants toted G3 assault rifles, a bulky weapon that Kenyan security services use, and intelligence analysts say this may mean the militants acquired their weapons from corrupt Kenyan officers, who are known to sell or rent out their guns, charging as little as a few dollars an hour.
After killing scores of shoppers, the militants retreated into a supermarket and used belt-fed machine guns to hold off the Kenyan forces, killing at least six.
"You don't bring something like a crew-served weapon through the door," an American official said, referring to heavy machine guns. "Those must have been stored well beforehand."
Another mystery: the women. Many witnesses have been emphatic that they saw at least two female militants, armed to the teeth and dressed in fatigues. Earlier this week, Kenyan officials asserted that there had been no women among the shooters, but on Tuesday Kenyatta seemed to revive the possibility that one of the assailants was a British woman.
Several intelligence analysts in Nairobi speculated that woman was Samantha Lewthwaite, a Muslim convert who had been married to one of the suicide bombers who struck London in 2005.
Kenyan authorities suspected that Lewthwaite had risen up the ranks of extremist groups and was leading a terrorism cell on the Kenyan coast; though they nearly swooped in on her in 2011, she escaped. In Kenya, she's now known as "the white widow."
Get the latest election news, live updates and election schedule for Lok Sabha Elections 2019 on ndtv.com/elections. Like us on Facebook or follow us on Twitter and Instagram for updates from each of the 543 parliamentary seats for the 2019 Indian general elections.