Partygoers went back and forth between festive and pensive reactions, depending on which race was displayed on the screen. Women milled about in sparkler headbands and red, white and blue fascinators. One woman wore a white gown adorned with the president’s name, spelled out in red glitter.

“I think I’m optimistic that the Senate is looking to have a very strong turnout,” said Clare Ath, 22, an outreach coordinator for the National Review Institute. “I did expect the House to turn blue because that’s usually how it goes.”

Mr. Trump, who had no public events on his schedule on Tuesday, had been focused on whether his dark closing message about the dangers of illegal immigration could once again help him defy the polls — this time showing that Democrats were likely to win control of the House and many governorships.

For days, Mr. Trump’s advisers had been warning him that the losses could be deep, even as they were saying that the Senate should be a bright spot. Advisers acknowledged that Mr. Trump has a problem with female voters as he engineers his own re-election effort.

The president knew his messaging may have gone too far, people close to him said, a sentiment reflected in an interview with an ABC affiliate owned by the Trump-friendly Sinclair Broadcasting.

“I would like to have a much softer tone. I feel, to a certain extent, I have no choice. But maybe I do,” Mr. Trump said in the interview after being asked about his regrets from his first two years in office. “And maybe I could’ve been softer from that standpoint.”

Even before Election Day, Mr. Trump had begun to change his public messaging to allow for a House loss by claiming that he himself was personally focused on the Senate contests in his campaign appearances.