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.

"It is a historic day for the people of Egypt," declared Vice President Joe Biden during an appearance in Kentucky.

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.

Biden said that throughout the unrest in Egypt, which led to Mubarak's ouster in under three weeks, Republicans and Democrats in the U.S. government have largely spoken with one voice.

"This unity has been important," Biden said. "And it will be even more important in these delicate and fateful days ahead."

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.

The tone from the White House has shifted right along with events. On Thursday afternoon, when Mubarak had been widely expected to step down, Obama was upbeat. "What is absolutely clear is that we are witnessing history unfold," Obama said at the start of an overshadowed economic event in Michigan. "It's a moment of transformation that's taking place because the people of Egypt are calling for change."

Instead Mubarak seemed to dig in defiantly, speaking of ceding power to his vice president and making interim concessions. Obama responded that it was not clear whether that move was a sufficient sign of reform and he called for a "credible, concrete and unequivocal path toward genuine democracy." A day later, Mubarak resigned after all.