WASHINGTON — 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.