Osama bin Laden recorded a chilling warning about the 9/11 bombing just a few weeks before the devastating attack on the World Trade Center, according to an analysis of a vast cache of al-Qaeda cassette tapes.

The collection of more than 1,500 audio tapes recovered from an Afghan compound after the US invasion in 2001 offer an extraordinary insight into the listening habits, influences and mindset of the terrorist organisation.

Flagg Miller, an expert in Arabic culture who was tasked with assessing the tapes for the Afghan media Project at Williams College in Massachusetts, said they included early speeches by Bin Laden in the late 1980s.

"What's fascinating is how Bin Laden is speaking about the ways in which the Arabian Peninsula is threatened - but who is the enemy? It's not the United States, as we often think, or the West. It's other Muslims," Miller told the BBC.

Miller, who has written a book about his findings titled The Audacious Ascetic, said Bin Laden’s focus only shifted to “the far enemy” after he was stripped of his Saudi citizenship, under US pressure, in 1994.

And he said it was not until one of the final recordings, during the wedding of Bin Laden’s bodyguard Umar, that there was any reference at all to the impending attack on New York that would change the path of the US “war on terror” for good.

Miller said: “There's a lot of mirth on the tape and then Bin Laden comes up, and it's no longer mirth. He talks about how celebration is important, but it mustn't overshadow more austere issues."

“He [then] talks explicitly about 'a plan' - he doesn't reveal details - and how we are 'about to hear news' and he asks God to 'grant our brothers success'.”

“I understand that to signify the 9/11 attacks [because] he is talking specifically about the United States at that juncture.”

Miller said the tapes, which include around 200 speakers besides Bin Laden, had taken a decade of painstaking work to decipher.

But they had almost been lost forever when the compound was first ransacked and a local family took them to wipe and sell on. They were convinced not to by a CNN cameraman, and were eventually handed to Miller for analysis in 2003.