The militant behind the Nairobi assault was deemed to be too radical and hot-headed even by Osama bin Laden, who rebuffed his request for a formal alliance with al-Qaeda.
Bin Laden warned Ahmed Abdi Godane, the "emir" of al-Shabaab, against forcing sharia on the local population before it was ready.
In a letter found in the former al-Qaeda leader's compound after his death, he said Godane should "remain devout, patient and persistent in upholding high moral values ... towards the community".
Bin Laden advised the young, aspiring global jihadist not to harm too many Muslim civilians in his attacks on Amisom, the African security mission in Somalia, suggesting he should "review this matter".
The letter was dated August 7, 2010, a month after al-Shabaab suicide bombers killed 74 people watching the World Cup final in Kampala, Uganda, which the group said was retaliation for the country's involvement in Somalia. The attack led to the United States placing a US$7 million ($8.4 million) bounty on Godane.
The declassified document was among 17 published by the Combating Terrorism Centre at West Point, the US military academy.
Bin Laden's concerns about Godane's impetuousness were shared by al-Shabaab leaders.
"They said he was going too fast and being too harsh in his implementation of sharia law," said Stig Hansen, author of a book on al-Shabaab and a professor at the Norwegian University of Life Sciences near Oslo. "The real problem was Godane was ignoring the due process of the group's sharia courts and imposing ad hoc solutions."
As al-Shabaab lost ground to Amisom, Godane's military decisions were questioned and internal arguments intensified, reaching a bloody climax this summer. In June, Godane loyalists killed two co-founders of the movement, including his former deputy and long-time friend, Ibrahim al-Afghani, and banished Mukhtar Robow, the spokesman. This month, Godane eliminated Alabama-born Omar Hammami, better known as al-Amriki - "the American" - who had criticised his methods.
Some analysts have said the attack on the Westgate mall was an attempt to reinvigorate al-Shabaab, whose territory has dwindled since Godane took over in 2008 when his predecessor was killed by an American air strike.
There are no known photographs of the Islamist leader, who communicates by audio messages and posts on jihadi forums. Born in 1977 in the breakaway state of Somaliland, he won a scholarship to study economics in Pakistan in 1998 or 1999 funded by a Saudi Arabian religious foundation.
Former colleagues have said that he spent some of that period receiving military training in Afghanistan.