Kenyan authorities had intelligence pointing to an attack in Nairobi a day before the Westgate mall assault.
According to counterterrorism documents, the Government and military were warned al-Shabaab planned an attack on the capital where they would storm a building and hold hostages.
There are also reports that Kenyan intelligence agents were at Westgate a few hours before the crowded shopping centre was attacked in a four-day siege that left at least 67 dead.
"We cannot say that this attack comes as a surprise," said Farah Maalim, former Deputy Speaker of the National Assembly. "The possibility of something like this happening, and of failures in the Kenyan intelligence community, has worried us for years."
Kenya refuses to comment on reports of warnings but officials say they are still investigating the relationship between the attackers and al-Shabaab's local offshoot, al-Hijra.
In the past, Kenya's large Somali-Kenyan population has borne the brunt of suspicion for involvement in terrorism, but sources say the authorities are now focusing investigations on ethnic Kenyan converts to Islam for suspected links in the Westgate attack.
One young convert was arrested and allegedly tortured last week, say human rights groups, for his suspected role in al-Hijra and Westgate. Allegations of human rights abuses and extrajudicial killings by the authorities have gone hand in hand with their continuing investigations into al-Shabaab and al-Hijra networks.
Terrorist activity in cells in cities such as Nairobi and Mombasa has led to a spate of arrests - including the attempted arrest of British woman Samantha Lewthwaite - and what are believed to be assassinations after senior figures such as Aboud Rogo Mohammed, a former leader of al-Hijra, have been killed in unexplained circumstances.
Experts say that as al-Shabaab has been weakened in Somalia it has focused more and more on Kenya and its al-Hijra cell. In a report this year, the United Nations group which monitors the activities of al-Shabaab points to the appointment of a new leader in Kenya last year, Sheikh Ahmad Iman Ali, as the impetus for a wave of grenade and bomb attacks that have killed scores in recent months. Observer