Saudi Arabia's intelligence apparatus has emerged from the shadows this weekend by playing a key role in preventing a possible mid-air disaster.
On Monday, a senior British official confirmed that Saudi counter-terrorism chiefs had simultaneously tipped off British, US and UAE intelligence about al-Qaeda's plans to send explosive devices on aircraft bound for the West.
The Saudis' source was a man called Jabr al-Faifi, a Saudi national from the mountainous south west of the country who spent time as an inmate in Guantanamo Bay.
After his release from there to the Saudi authorities, Faifi spent time in a government rehabilitation programme but, like many other returning militants, his renunciation of violence was a bluff and, after his release, he went on to join al-Qaeda in the Arabian Peninsula (AQAP).
This earned him the position of number 20 on the Saudi government's list of 85 most-wanted militants.
But in mid-October Faifi handed himself in to the Saudi authorities and since then he appears to have reached a deal with his interrogators, giving them a wealth of detail about al-Qaeda's operations in Yemen and Saudi Arabia, in exchange for escaping conviction and a severe penalty.
Unlike 10 years ago, when the Saudis frequently kept such information to themselves, they were quick to share it with their counter-terrorism partner agencies, including the CIA and MI6.
Hence the Dubai authorities were able to swiftly identify the suspect package even though it had passed undetected through Yemen's own airport security and had already flown on two Qatar Airways flights across the Middle East.
Commenting on this international sharing of information, the Saudi interior ministry spokesman, Mansour al-Turki, said: "Saudi Arabia believes in the importance of promptly exchanging security information of intelligence nature as a fundamental tool in combating terrorism."
So why the Saudi connection when AQAP is supposed to be anchored in Yemen?
The answer is that much of the brains of that organisation come from fanatical yet well-educated young Saudi jihadists who have slipped across the semi-porous Saudi-Yemeni border to escape the security crackdown in their own country to join AQAP in its remote hideouts in Yemen's Shabwa, Marib and Abyan provinces.
Saudi intelligence keeps elaborate files on each of these departed militants, knowing that their prime target is the Saudi government itself, its leading princes, its security officials and sometimes its oil infrastructure.
At periodic intervals the Saudi government announces mass arrests of militants who have sneaked back across the border from Yemen, or the interception of armed militant cells close to the joint border, or the discovery of extensive caches of weapons and explosives.
Difficult to operate
Before the 2003 triple suicide bombings by AQAP in Riyadh - which killed more than 30 people - Saudi intelligence had a poor handle on what al-Qaeda was up to and what it was capable of.
A leading prince even boasted that "we have no al-Qaeda sleeper cells in this country; if we did we would have woken them up long ago".
He was in for a rude surprise.
But seven years on, with major technical and forensic input from various countries, the Saudis have emerged as one of the most effective counter-terrorism agencies in the world.
Their critics say this has come at the expense of human rights and that suspects are often rounded up and incarcerated on the flimsiest of pretexts.
Others believe the Saudis have been lenient to the point of being gullible, releasing dangerous jihadists onto the streets who go straight on to join or rejoin al-Qaeda.
Either way, the effect of the Saudi intelligence-driven counter-terrorism campaign has been to make Saudi Arabia a difficult country for al-Qaeda to operate in.
Hence the merging, in January 2009, of the Saudi and Yemeni branches into a small but rejuvenated and clearly dangerous entity - the al-Qaeda in the Arabian Peninsula.