An intercepted secret message between al Qaida chief Ayman al-Zawahri and his deputy in Yemen about plans for a major terror attack was the trigger for the current shutdown of many US embassies.
A US intelligence official and a Mideast diplomat said al-Zawahri's message was picked up several weeks ago and appeared to initially target Yemeni interests.
The threat was expanded to include American or other Western sites abroad, officials said, indicating the target could be a single embassy, a number of posts or some other site. Politicians have said it was a massive plot in the final stages, but they have offered no specifics.
The intelligence official said the message was sent to Nasser al-Wahishi, the head of the terror network's organisation, based in Yemen, known as al Qaida in the Arabian Peninsula.
American spies and intelligence analysts scoured email, phone calls and radio communications between al Qaida operatives in Yemen and the organisation's senior leaders to determine the timing and targets of the planned attack.
The call from al-Zawahri, who took over from Osama bin Laden after US Navy Seals killed him in May 2011, led the Obama administration to close diplomatic posts from Mauritania on Africa's west coast to Bangladesh, and as far south as Madagascar.
Authorities in Yemen, meanwhile, released the names of 25 wanted al Qaida suspects and said they had been planning terrorist attacks targeting "foreign offices and organisations and Yemeni installations" in the capital Sanaa and other cities across the country.
The Yemeni government also went on high alert, stepping up security at government facilities and checkpoints.
Officials in the US would not say who intercepted the initial suspect communications - the CIA, the National Security Agency, the Defence Intelligence Agency or one of the other intelligence agencies - that kicked off the closure of US facilities.
But an intelligence official said the controversial NSA programmes that gather data on American phone calls or track internet communications with suspected terrorists played no part in detecting the initial tip.