The mood in the White House overnight was tense.
The president's staffers and campaign officials stayed there through much of the night - their boss's job was on the line, and all they could do was wait and drink alcohol. Lots of it.
On Tuesday morning, women in the West Wing had showed up for work in festive attire: Republican-red sweaters, skirts and stilettos, looking as if they had texted each other to agree the dress code. Throughout the day and into the night, they watched election returns and wondered what would happen.
Then the president pulled ahead of his Democratic rival Joe Biden in Florida. The mood brightened. A table in the office of Press Secretary Kayleigh McEnany was littered with wine bottles and bags of crisps.
Still the mood was edgy. One staffer cradled a beer bottle in his arm, the label partly peeled off. These occupants of the West Wing - the heart of any White House administration - were nervous, though they tried to project strength and confidence.
"We're feeling very good," one told me. She talked about the returns from Florida that showed the president in the lead. "We're very optimistic."
She smiled, cautiously.
Behind her, the volume on a TV screen was turned up, blaring updates. A newscaster warned of "socialist anarchy", making a dire prediction of what would happen if the Democrats won.
A copy of the the New York Post newspaper lay on a bookshelf, and the room smelled of "Cosy Cashmere" - a pink scented candle. In a nearby office, a White House staffer patted his colleague's shoulder, trying to calm his nerves.
Elsewhere in the building, the president's re-election party was getting under way. Hundreds had been invited, and some of the guests, draped in red silk, walked under a sky so clear you could see the stars, as they made their way to the event.
The party was a break with tradition. There is no law that forbids the president from hosting a celebration at the White House on election night. But no other president has organised a gathering like this one.
Mr Trump's predecessors, whether Republican or Democrat, tried to maintain some distance between campaigning and governing. To be sure, the line between the two activities sometimes got blurry.
Presidents Ronald Reagan and Barack Obama both used rooms at the White House as a backdrop for their political campaigns. Still they tried to make a distinction between campaign activities and their work as president. On election night in the Trump White House, that line seemed to have been obliterated.
Many recoiled at his choice of venue for the party.
One of them, Gordon Adams, a professor emeritus at American University, was a senior White House official for national security budgets in 1996. He spent election night that year with President Bill Clinton in Arkansas. Afterwards Adams flew back to Washington with his colleagues, and a charter bus dropped them off at the White House.
"It was eerily quiet," he says. "There was nobody there, celebrating."
When he heard about the election night party Trump had planned for the White House, Adams was not pleased.
"It rankles," he said.
The party in the East Room was just one of the ways the president broke with tradition on election night.
His campaign officials worked in an office on the White House grounds, a "war room" that was established in the Eisenhower Executive Office Building, next door to the West Wing. Critics of the president say these kinds of political activities should not be conducted within the White House compound.
In response to the criticism, Tim Murtaugh, a spokesman for Trump's campaign, said that the campaign room violated no rules. "There is no expense whatsoever to American taxpayers," he said in a statement.
Murtaugh and the president's supporters love the way their man has shaken things up in Washington and broken with tradition. His unconventional approach may be exactly what helps him get re-elected.
At the party itself, Trump appeared at a podium and gave a speech. Standing before his supporters, he made the false claim that he had won the election.
"As far as I'm concerned, we already have won this," he said. People in the room cheered.
In fact, millions of votes have not yet been counted, and many people who heard his remarks on TV were stunned. For them, the speech was a disturbing end to an unprecedented election night, one that was like the president himself - full of shocking surprises.