President Obama was angry. He was on the phone with President Dmitri A. Medvedev last month to finalize a new arms control treaty with Russia, only to be confronted with new demands for concessions on missile defense. A deal that was supposed to be done was unraveling.

“Dmitri, we agreed,” Mr. Obama told Mr. Medvedev with a tone of exasperation, according to advisers. “We can’t do this. If it means we’re going to walk away from this treaty and not get it done, so be it. But we’re not going to go down this path.”

Mr. Obama hung up and vented frustration. Some of his advisers had never seen him so mad. A picture taken by a White House photographer captured his grim face in that moment of uncertainty. For a year he had been trying to forge a new relationship with Russia, starting with a treaty to slash nuclear arsenals. And for a year Russia had been testing him, suspecting he was weak and certain it could roll over him.

If Mr. Obama overestimated his powers of persuasion in reaching quick agreement with the Russians, they misjudged how far they could get him to bend. In the end, they compromised on nonbinding language. And so, after all the fits and starts, all the miscalculations, the vodka toasts that proved premature and the stare-downs that nearly sank the whole enterprise, Mr. Obama hung up the phone again with Mr. Medvedev on Friday, this time having finally translated aspiration into agreement.