For both President Barack Obama and his secretary of state, Hillary Clinton, the bid to broker a cease-fire in Gaza was high-profile, high-risk diplomacy.
"It's a significant decision to send the secretary of state into an uncertain situation that puts American credibility and influence on the line," a senior State Department official tells CNN. "I have the beginnings of ulcers to show that this was not a done deal when we left" for the Middle East.
Planning for Clinton's possible "shuttle diplomacy" trip to the Middle East -- cutting short a trip with Obama to Southeast Asia -- began Sunday, the official says. When Clinton and her staff arrived in Thailand, they began conversations with the president's senior staff. Did the potential benefits of going outweigh the risks?
Over lunch in Myanmar, Obama and Clinton discussed gaps between Egyptian and Israeli proposals for a cease-fire and how the U.S. might most effectively play a supporting role.
On Monday, the president called key players, Israeli Prime Minister Benjamin Netanyahu and Egyptian President Mohamed Morsy. By Tuesday, the decision had been made: Clinton would fly to the region. The staff began putting the wheels in motion for a mid-afternoon departure from Phnom Penh, Cambodia. She would arrive in Israel at 10 p.m. local time and go directly to a meeting with Netanyahu.
But before she left for the airport, Clinton, Obama and a small group of senior staff huddled once again, walking through the basic strategy, how to announce the trip and how to categorize it.
"We were still, as we drove out to the airport, working out the timing of the meetings at various stops," the senior official tells CNN. "That's how quickly this was all coming together."
The president's deputy national security adviser for strategic communications Ben Rhodes announced the trip as Clinton's plane was taxiing down the runway.
Clinton and her staff flew from Phnom Penh, via Mumbai, India, to Tel Aviv, Israel. As soon as they arrived, they drove directly to the prime minister's office in Jerusalem for Clinton's meeting with Netanyahu. They talked for two and a half hours, discussing Israel's strategic considerations, its concerns about a cease-fire, the terms it wanted and how Israel wanted to address longer-term issues, including weapons smuggling.
Overnight, she and her staff mulled over what to propose to the Egyptians, who had their own proposal for a cease-fire with Hamas.
The next day, Clinton traveled to Ramallah to meet with the president of the Palestinian Authority, Mahmoud Abbbas, and returned to Jerusalem for yet another meeting with Netanyahu and other senior officials. They talked about the potential for a call from Obama to Netanyahu that would include subjects such as the Iron Dome air defense system and arms smuggling.
Once again, Clinton boarded her plane for a short flight to Cairo, Egypt, carrying with her the terms of a possible cease-fire.
"The secretary met with President Morsy for about an hour, and they literally sat there with the paper in their hands, marked up with potential changes to it," the State Department official tells CNN. "So it was that level of specificity that she and President Morsy -- as well as the Egyptian foreign minister and national security adviser -- were getting into."
At the end of meeting, Clinton told the officials that what they had agreed on was consistent with what the Israelis wanted, but she needed one more discussion with Netanyahu to make sure he was comfortable with the terms. She urged the Egyptians to check with the Palestinian factions to make sure they were comfortable as well.
Clinton was taken upstairs to a conference room, where she called Netanyahu. Then there was a second call to clarify some points. Finally, Netanyahu said he was ready for a call from Obama.
At 7:30 p.m. local time, Clinton and the Egyptian foreign minister Mohamed Amr announced that the cease-fire would go into effect at 9 p.m.
"You could not have a more textbook case of on-the-ground diplomacy, where she is literally word-smithing the final cease-fire documents with both the prime minister of Israel and the president of Egypt," the State Department official says.
She was "sitting there with the paper, with a pen in her hand, making small edits, underlining things, passing words back and forth, debating phrases. And all the while, also stepping back and saying 'What's the larger strategic picture here? Why is it so important for you, Prime Minister Netanyahu, to close this out? Why is it important for you, President Morsy, to close this out?'"
As for the U.S. role, the official says the question was what assurances the U.S. could give, especially to the Israelis, "that as far as missile defense is concerned, and arms smuggling is concerned, we'll be there for them so that this doesn't just repeat itself in a few weeks' time."
"We were taking a risk in doing this," this official says. "We were putting both her credibility on the line and the United States' credibility on the line, and ultimately we decided the stakes were too high not to do it, but there was a very real risk that this would not succeed."
Amid the nail-biting by her staff, Clinton was "resolute," the official says. "She thought this was the right course of action for Israel's interest, for regional stability. She felt at the end of the day that would shine through if you could get people focused on the big picture, and that's what she was trying to do."
Clinton's political skills helped, but the official notes that "these are not just political arguments, because we're talking about issues of life and death and existential threats ... it's also about statesmanship and strategy. So she had to be as much a diplomat as politician to be able to grapple with problem at stake."
As Clinton headed for the airport to return to Washington, cease-fire in hand, the official says, "we were not jubilant, we were not really excited."
"Because we recognized that this is a first step; it's fragile, it remains risky; there remain very real underlying problems that need to be dealt with."
"This was not pop-open-the-champagne time. It was job well done, and now let's get to work on the next thing."