Gone was the ballroom with the soaring glass ceiling, the confetti and the celebrity guest stars. Instead, Hillary Clinton looked out to a group of grief-stricken aides and tearful supporters, as she acknowledged her stunning loss of the presidency to Donald Trump.

Clinton’s voice crackled with emotion as she said, “This is painful, and it will be for a long time.” But she told her faithful to accept Trump and the election results, urging them to give him “an open mind and a chance to lead.”

Before Clinton took the stage at a New York City, top aides filed in, eyes red and shoulders slumped, as they tried to process the celebrity businessman’s shock victory the night before after a campaign that appeared poised until Election Day to make Clinton the 45th US president.

But while many on her team were still struggling to come to terms with the loss the morning after the aborted celebration, Clinton herself was well aware the evening before that the seemingly impossible was in fact taking place.

Democratic presidential candidate Hillary Clinton delivers her concession speech after being defeated by Republican president-elect Donald Trump, in New York on November 9, 2016. (AFP Photo/Jewel Samad)

Democratic presidential candidate Hillary Clinton delivers her concession speech after being defeated by Republican president-elect Donald Trump, in New York on November 9, 2016. (AFP Photo/Jewel Samad)

According to Jonathan Allen and Amie Parnes’s new book, “Shattered: Inside Hillary Clinton’s Doomed Election Campaign,” the first of many books likely to purport to tell the inside story of the failed bid, it was Barack Obama who urged Clinton to bite the bullet and accept the shocking loss.

At around 11 p.m., the book reports, a senior Obama administration aide called Clinton’s campaign manager, Robby Mook, to tell her that the president “doesn’t think it’s wise to drag this out.” Networks were already projecting the loss and Trump only needed a handful of remaining electoral college seats to pass the margin for victory.

Donald Trump delivers his victory speech to his supporters in New York City on November 8, 2016, with his family members standing beside him (Eric Cortellessa/Times of Israel)

Donald Trump delivers his victory speech to his supporters in New York City on November 8, 2016, with his family members standing beside him (Eric Cortellessa/Times of Israel)

But while she may have known what was to come, Clinton didn’t want to concede just yet.

“I’m not ready to go give this speech,” Clinton reportedly said. “Though she focused her pushback on the nature of her remarks — How should she frame the election of Donald Trump? What would she say to little girls and elderly women who treated her as a champion? Could she hit the right notes? — the effect was the same. Hillary wasn’t quite ready to put an end to the dream she’d pursued for at least the past decade,” they wrote.

The next call, however, came from Obama himself and “crystallized everything for Hillary,” the authors said.

“You need to concede,” he told her.

Clinton replied: “Mr President, I’m sorry.”

The result was startling to Clinton, who had ended her campaign with a whirlwind tour of battleground states and had projected optimism that she would maintain the diverse coalition assembled by Obama in the past two elections.

President Barack Obama and Democratic presidential candidate Hillary Clinton hold hands as they walk off stage after both spoke at a rally at Independence Mall in Philadelphia. Monday, November 7, 2016. (AP Photo/Pablo Martinez Monsivais)

President Barack Obama and Democratic presidential candidate Hillary Clinton hold hands as they walk off stage after both spoke at a rally at Independence Mall in Philadelphia. Monday, November 7, 2016. (AP Photo/Pablo Martinez Monsivais)

On the final day of the campaign, Clinton literally followed Obama to stand behind a podium with a presidential seal at a massive rally outside Independence Hall in Philadelphia. As she walked up to the lectern, the president bent down to pull out a small stool so the shorter Clinton could address the tens of thousands gathered on the mall. Before leaving the stage, Obama leaned over to whisper a message in Clinton’s ear. “We’ll have to make this permanent,” he told her cheerfully in words that would end up ringing hollow.

“Now, though, with the president placing a consolation call, the reality and dimensions of her defeat hit her all at once. She had let him down. She had let herself down. She had let her party down. And she had let her country down. Obama’s legacy and her dreams of the Presidency lay shattered at Donald Trump’s feet. This was on her,” Allen and Parnes wrote.

After the brief conversation with Obama, Clinton made a very different call, to congratulate president-elect Trump.

AP contributed to this report.