President Obama skipped dessert at a long summit meeting dinner in Cambodia on Monday to rush back to his hotel suite. It was after 11:30 p.m., and his mind was on rockets in Gaza rather than Asian diplomacy. He picked up the telephone to call the Egyptian leader who is the new wild card in his Middle East calculations.
Over the course of the next 25 minutes, he and President Mohamed Morsi of Egypt hashed through ways to end the latest eruption of violence, a conversation that would lead Mr. Obama to send Secretary of State Hillary Rodham Clinton to the region. As he and Mr. Morsi talked, Mr. Obama felt they were making a connection. Three hours later, at 2:30 in the morning, they talked again.
The cease-fire brokered between Israel and Hamas on Wednesday was the official unveiling of this unlikely new geopolitical partnership, one with bracing potential if not a fair measure of risk for both men. After a rocky start to their relationship, Mr. Obama has decided to invest heavily in the leader whose election caused concern because of his ties to the Muslim Brotherhood, seeing in him an intermediary who might help make progress in the Middle East beyond the current crisis in Gaza.
The White House phone log tells part of the tale. Mr. Obama talked with Mr. Morsi three times within 24 hours and six times over the course of several days, an unusual amount of one-on-one time for a president. Mr. Obama told aides he was impressed with the Egyptian leader's pragmatic confidence. He sensed an engineer's precision with surprisingly little ideology. Most important, Mr. Obama told aides that he considered Mr. Morsi a straight shooter who delivered on what he promised and did not promise what he could not deliver.
"The thing that appealed to the president was how practical the conversations were — here's the state of play, here are the issues we're concerned about," said a senior administration official who spoke on the condition of anonymity to discuss private conversations. "This was somebody focused on solving problems."
The Egyptian side was also positive about the collaboration. Essam el-Haddad, the foreign policy adviser to the Egyptian president, described a singular partnership developing between Mr. Morsi, who is the most important international ally for Hamas, and Mr. Obama, who plays essentially the same role for Israel.
"Yes, they were carrying the point of view of the Israeli side but they were understanding also the other side, the Palestinian side," Mr. Haddad said in Cairo as the cease-fire was being finalized on Wednesday. "We felt there was a high level of sincerity in trying to find a solution. The sincerity and understanding was very helpful."
The fledgling partnership forged in the fires of the past week may be ephemeral, a unique moment of cooperation born out of necessity and driven by national interests that happened to coincide rather than any deeper meeting of the minds. Some longtime students of the Middle East cautioned against overestimating its meaning, recalling that Mr. Morsi's Muslim Brotherhood constitutes a philosophical brother of Hamas even if it has renounced violence itself and become the governing party in Cairo.
"I would caution the president from believing that President Morsi has in any way distanced himself from his ideological roots," said Robert Satloff, executive director of the Washington Institute for Near East Policy. "But if the president takes away the lesson that we can affect Egypt's behavior through the artful use of leverage, that's a good lesson. You can shape his behavior. You can't change his ideology."
Other veterans of Middle East policy agreed with the skepticism yet saw the seeds of what might eventually lead to broader agreement.
"It really is something with the potential to establish a new basis for diplomacy in the region," said Tamara Cofman Wittes, who was Mr. Obama's deputy assistant secretary of state for the Middle East until earlier this year and now runs the Saban Center for Middle East Policy at the Brookings Institution. "It's just potential, but it's particularly impressive potential."
The relationship between the two leaders has come a long way in just 10 weeks. Mr. Morsi's election in June as the first Islamist president of Egypt set nerves in Washington on edge and raised questions about the future of Egypt's three-decade-old peace treaty with Israel. Matters worsened in September when Egyptian radicals protesting an anti-Islam video stormed the United States Embassy in Cairo.
Mr. Obama was angry that the Egyptian authorities did not do more to protect the embassy and that Mr. Morsi had not condemned the attack. He called Mr. Morsi to complain vigorously in what some analysts now refer to as the woodshed call. Mr. Morsi responded with more security for the embassy and strong public statements that the attackers "do not represent any of us."
Washington was again leery when the Gaza conflict broke out last week and Mr. Morsi sent his prime minister to meet with Hamas. But as days passed, Mr. Obama found in his phone calls that Mr. Morsi recognized the danger of an escalating conflict.
During their phone call on Monday night, Mr. Obama broached the idea of sending Mrs. Clinton. Mr. Morsi agreed it would help. The president then called Prime Minister Benjamin Netanyahu of Israel to talk through the idea. At 2:30 a.m., having changed out of his suit into sweats, Mr. Obama called Mr. Morsi back to confirm that Mrs. Clinton would come.
After leaving Phnom Penh the next day en route back to Washington, Mr. Obama picked up the phone aboard Air Force One to call Mr. Morsi to say Mrs. Clinton was on the way. By Wednesday, he was on the phone again with Mr. Netanyahu urging him to accept the cease-fire and then with Mr. Morsi, congratulating him.
"From Day 1, we had contacts with both sides," said Mr. Haddad, but the United States stepped in "whenever there was a point at which there would be a need for further encouragement and a push to get it across." Mr. Haddad said the United States played an important role "trying to send clear signals to the Israeli side that there should not be a waste of time and an agreement must be reached."
"They have really been very helpful in pushing the Israeli side," he said.
In pushing Hamas, Mr. Morsi came under crosscurrents of his own. On one side, advisers acknowledged, he felt the pressure of the Egyptian electorate's strong support for the Palestinian cause and antipathy toward Israel as well as his own personal and ideological ties to the Islamists in Hamas. But on the other side, advisers said, Mr. Morsi had committed to the cause of regional stability, even if it meant disappointing his public.
Analysts further noted that Mr. Morsi needed the United States as he secures a $4.8 billion loan from the International Monetary Fund at a time of economic trouble. "There's no way Egypt is going to have any kind of economic recovery without Washington," said Khaled Elgindy, an adviser to the Palestinian negotiators during the last decade.
As for Mr. Obama, his aides said they were willing to live with some of Mr. Morsi's more populist talk as long as he proves constructive on the substance. "The way we've been able to work with Morsi," said one official, "indicates we could be a partner on a broader set of issues going forward."
Peter Baker reported from Washington, and David D. Kirkpatrick from Cairo.