Hours past a midnight deadline to clinch a Greek bailout deal, German Chancellor Angela Merkel and Greek Prime Minister Alexis Tsipras were about to walk away from the table- exhausted from all-night talks filled with threats, shouting and ultimatums.
A single text message rescued the talks and possibly the euro. Dutch Premier Mark Rutte, a hard-liner on Greek reform waiting outside with other leaders, sent European Union President Donald Tusk an SMS proposing a compromise on the last sticking point keeping the two sides apart.
For three hours, Merkel, Tsipras, Tusk and French President Francois Hollande had been stuck in dead-end closed-door talks, and the message suddenly made something click. Within an hour, the deal was clinched.
This account of the dramatic events that led to a last-minute bailout agreement for Greece has been pieced together from interviews with a half-dozen officials from EU nations and institutions who attended the negotiations over the past months. They spoke on condition of anonymity because the talks were not public.
Announcing the deal later that morning, Tusk, the summit host -who had been instrumental in keeping the opposing sides together before the text message landed -tried to lighten the mood with corny humor. "We have an a-Greek-ment," he declared.
It was not enough to sweep away the months of bitterness leading to that moment. The negotiations, watched with trepidation around the world, swung from despair to hope and back again as leaders groped for a pact that would keep Greece in the euro and keep global markets steady.