“How do you get Impeached when you have done NOTHING wrong (a perfect call), have created the best economy in the history of our Country, rebuilt our Military, fixed the V.A. (Choice!), cut Taxes & Regs, protected your 2nd A, created Jobs, Jobs, Jobs, and soooo much more? Crazy!” Mr. Trump wrote Friday morning.

Mr. Trump was in a meeting in the White House residence and not watching television as the Judiciary Committee vote began, but he kept his aides close throughout morning. That group included two in-house strategists focused on impeachment messaging: Tony Sayegh, a former Treasury Department spokesman, and Pam Bondi, a former Florida attorney general. Other advisers described the president, who has publicly and privately marveled over the unity he sees in the Republican Party around impeachment, as in good spirits.

Another ally in the mix was Rudolph W. Giuliani, the president’s personal lawyer whose work to dredge up unflattering information on Mr. Trump’s political opponents landed him at the center of the Democratic-led impeachment effort.

Mr. Giuliani was ushered into the White House moments before the vote, and one senior administration official said he was there, in part, to talk about a trip he had taken to interview Ukrainians in Budapest and Kyiv, Ukraine’s capital, for an anti-impeachment documentary.

Last month, Mr. Giuliani told an associate that Mr. Trump had approved of his participation in the documentary when he briefed the president about it during a meeting at the Trump International Hotel in Washington.

By the time the Paraguayan president arrived at the White House just before noon, Mr. Trump was flanked by several additional advisers, including Vice President Mike Pence, Secretary of State Mike Pompeo and Robert C. O’Brien, his national security adviser.

“It’s a very sad thing for our country but it seems to be very good for me politically,” Mr. Trump said. “The polls have gone through the roof for Trump.”