Correction to This Article
Earlier versions of this article incorrectly said that a speech the president delivered late Thursday took place at 10 p.m. Cairo time. He spoke at 11 p.m. It also said that Vice President Omar Suleiman announced Mubarak's departure Friday at 11 a.m. Cairo time. Suleiman spoke at 6:04 p.m. This version has been corrected.

In Mubarak's final hours, defiance surprises U.S. and threatens to unleash chaos

After a week of crossed signals and strained conversations, the Obama administration finally had good news: Late Wednesday, CIA and Pentagon officials learned of the Egyptian military's plan to relieve President Hosni Mubarak of his primary powers immediately and end the unrest that had convulsed the country for more than two weeks.

The scheme would unfold Thursday, with the only uncertainty being Mubarak's fate. "There were two scenarios: He would either leave office, or he would transfer power," said a U.S. government official who was briefed on the plan. "These were not speculative scenarios. There was solid information" and a carefully crafted script.

But the Egyptian president decided at the last minute to change the ending.

"Mubarak called an audible," the official said.

The Egyptian president startled many of his aides with an address, unseen by others, in which he appeared determined to cling to office. The speech surprised and angered the White House, enraged Cairo's legions of protesters and pushed the country closer to chaos, current and former U.S. government officials said in interviews recounting the events of the past 48 hours.

In the end, Mubarak's efforts only ensured a hasty and ignominious departure, the officials said. Within hours of the speech, Egyptian army officials confronted the discredited president with an ultimatum: Step down voluntarily, or be forced out.

Mubarak's defiant speech - described by some U.S. officials as bordering on delusional - was a final, wild plot twist in a saga that had played out in Egypt and Washington over the past 18 days. The likelihood of Mubarak's departure alternately rose and dipped as U.S. military officers and diplomats quietly worked with their Egyptian counterparts in a search for peaceful resolution to the country's worst unrest in six decades.

By midweek, confronted with growing throngs in Cairo, labor strikes and deteriorating economic conditions, top military and civilian leaders reached an apparent agreement with Mubarak on some form of power transfer. The details of the plan - and how it unraveled Thursday - were described in interviews with six former and current U.S. government officials who were knowledgeable about the details. Most of the sources insisted on anonymity in order to talk about the administration's internal policy discussions and diplomatic exchanges with Egyptian officials.

Communication between top U.S. and Egyptian officials had become increasingly sporadic early this week as Mubarak deputies complained publicly about U.S. interference in Cairo's affairs. But then U.S. intelligence and military officials began to learn details of the plan by Egyptian military leaders - something between a negotiated exit and a soft coup d'etat - to relieve Mubarak of most, if not all, of his powers.

The plan went into effect Thursday with announcements in Cairo to pro-democracy demonstrators that their key demands were about to be met. A rare meeting was convened of Egypt's Supreme Council of the Armed Forces, and afterward a military spokesman released a communique that seemed to assert the army's control over the government. The statement stressed "the responsibility of the armed forces and its commitment to protect the people and its keenness to protect the nation."

The statement prompted cheers among the hundreds of thousands of demonstrators who had gathered in Cairo's Tahrir Square anticipating an announcement of Mubarak's departure.

Hours later in Washington, CIA Director Leon Panetta made a scheduled appearance before the House Intelligence Committee. Asked about Egypt, he cited reports suggesting a "strong likelihood that Mubarak may step down this evening." The CIA retreated from the assertion, saying the director was referring to news reports, but the agency's classified cables continued to point to a likely transfer of power in Egypt that day, according to two U.S. officials familiar with the intelligence.