The cease-fire between Hamas and Israel has been a political boost for Egyptian President Mohammed Morsi. The Islamist leader spent hours in meetings and on the phone with world leaders, including President Obama, and got results: a cessation of violence that puts Egypt back on the international map. But Morsi faces a test Thursday night, when negotiations on the details begin.
U.S. Secretary of State Hillary Clinton called it "a critical moment for the region" after the cease-fire deal was announced in Cairo. "Egypt's new government is assuming the responsibility and leadership that has long made this country a cornerstone of regional stability and peace," she said.
It's a ringing endorsement just a few months after the U.S.-Egyptian relationship under this Islamist president came into question.
In an interview with Telemundo in September, President Obama struck a wait-and-see attitude.
"I don't think that we would consider them an ally, but we don't consider them an enemy. They are a new government that's trying to find its way," he said of Egypt.
But analysts say Morsi has proved himself and his organization, the Muslim Brotherhood, to be major political players on the world stage, and if the cease-fire agreement between Hamas and Israel holds, it will be a shining achievement. But it's also a risk: Morsi made Egypt the guarantor of the cease-fire.
Samer Shehata, an Egypt expert at Georgetown University, calls the deal "an unmitigated victory for Morsi."
Morsi used Egypt's historic links with Israel through its intelligence to convey messages to the Israeli government from Hamas, while speaking directly to the Hamas leadership as well as other Palestinian factions during the eight-day crisis.
"Morsi did something seemingly undoable: He condemned the Israeli military action and supported the Palestinian people," Shehata says, "and at the same time was actively involved and seen as the most likely broker for a truce."
Although Hamas is the ruler of the Palestinian Gaza Strip, in the past it was never welcomed at the negotiating table. The United States and Israel won't speak to Hamas, labeling it a terrorist organization.
But in this new Middle East, where many compliant Western-backed dictators are replaced with Islamist elected leaders, Morsi, Shehata says, became the only feasible mediator. He spoke to world leaders, from Iran, historic backers of Hamas, to the United States. And using his links with Hamas, an offshoot of the regional Muslim Brotherhood, he conveyed messages back and forth — all while taking a line very different from Egypt's Western ally, the United States: blaming Israel for the aggression.
Shehata says Egyptians and the world saw Morsi act quickly and effectively.
Although Egypt has had a traditional role in mediating between Israel and the Palestinians in the past, it was done through the head of intelligence, and analysts say deposed Egyptian President Hosni Mubarak was seen as a lackey of the U.S.
Shehata says this time it was starkly different.
"Mubarak was only symbolically there. Morsi was front and center. He was the one involved and he's the one who gets credit," he says.
Israel and Hamas don't agree on much. But with Morsi's help, they did agree to a cease-fire Wednesday night. Israel also promised to stop assassinating Hamas leaders and to ease the blockade on Gaza.
Israel praised Egypt's role. And Hamas political leader Khaled Meshaal paid tribute to Morsi during a news conference in Cairo.
"I thank Egypt and above all the dear brave Egyptian president. The Egyptian president, since the attack started, acted like a real Muslim and Arab leader. Also, when the escalations increased, he gave instructions that helped reach this stage," Meshaal said.
He added that Morsi did not sell out "the resistance," as Hamas refers to itself, to Israel's occupation while getting both sides to compromise.
Meshaal was defiant.
"God revealed the weakness of Israel on the hands of the heroes of Gaza. We are proud of what the heroes achieved. We are out of this battle with our heads high," he said.
While this is an unquestionable win for Morsi internationally, domestically the problems are more complicated in this nascent democracy.
The constitutional writing process is falling apart along Islamist-liberal lines. In downtown Cairo, intense battles rage between police and protesters. And the economy is faltering.
Morsi's actions on those issues, observers say, are how he and the Muslim Brotherhood will be judged in Egypt.