CAIRO (AP) -- Caught up in stunning news like the rest of the world, President Barack Obama learned of Egyptian President Hosni Mubarak's resignation during an Oval Office meeting. He watched the celebration on television and prepared to make an afternoon statement.

The development came just one day after Mubarak had declared that he was not resigning, despite all signs to the contrary, which enraged the protesting masses and had a dismayed White House scrambling to respond. Obama had issued a statement Thursday evening in Washington in which he challenged Mubarak, without directly naming him, to explain his actions and his plans for democracy.

And then events changed again.

Obama quickly made plans to speak about Egypt at 1:30 p.m. EST from the White House as throngs of activists rejoiced in Cairo.  U.S. lawmakers welcomed Mubarak's resignation.

"I am pleased that President Mubarak has heard and heeded the voice of the Egyptian people, who have called for change," said Senate Majority Leader Harry Reid of Nevada. "It is crucial that Mubarak's departure be an orderly one and that it leads to true democracy for Egypt, including free, fair and open elections."

On Twitter, Nancy Pelosi, the House Democratic leader, said the young people of Egypt were leading the country to democracy.  "Their actions are an inspiration to the world," she said.

Mubarak resigned as president and handed control to the military on Friday after 29 years in power.

Now enormous questions loom about how the country will transition to free elections in September, which in turn will affect the important relationship between the U.S. and Egypt.