Asked about Ms. Yovanovitch’s testimony before he left Washington, Mr. Trump said that Volodymyr Zelensky, the Ukrainian president, “didn’t speak favorably” about her during the July 25 phone call that has formed the basis of the impeachment inquiry.

Amid it all, Mr. Trump left again for the campaign trail, which he has long employed as a useful conduit for his most provocative language, particularly when he feels the confines of Washington closing in.

Upon landing, he announced the departure of Kevin McAleenan, the acting secretary of homeland security who had publicly expressed frustration with the job in recent weeks. Once the president took the stage in this southwestern corner of the state, he defended himself against those pursuing impeachment, singling out Ms. Pelosi and Representative Adam Schiff, the chairman of the House Intelligence Committee.

Mr. Schiff’s decision during a committee hearing to liken the president’s remarks in the July 25 call to a mobster issuing a veiled threat drew the president’s ire on Friday, as it had for weeks.

Sign up for On Politics to get the latest election and politics news and insights. Sign up for our politics newsletter

“He made it up: It was fiction,” Mr. Trump said. “I don’t know, congressman, are you immune from something like that? That should be a crime.”

Throughout the rally, Mr. Trump seemed to abruptly switch emotional channels. He toggled between lashing out at Democrats to acting out an imagined back-and-forth between two former F.B.I. officials, Lisa Page and Peter Strzok, in order to mock them for exchanging unflattering text messages about Mr. Trump during his candidacy. He also paused at one point to interview Little League ballplayers about their pitching speeds.

Eventually, he circled back to his original purpose for the visit: testing his political influence over local races ahead of Saturday’s primary election, largely following the same attack-style playbook he deployed last month in a close North Carolina race.