President Donald Trump on Wednesday trashed losing Republican candidates who distanced themselves from him during the midterm elections.

"Mia Love gave me no love, but then she lost," Trump said at a White House news conference of the Utah Republican who failed in her House re-election bid on Tuesday. "Too bad."

He listed several other GOP lawmakers he said had rejected his "embrace" before falling to Democratic opponents: Reps. Carlos Curbelo in Florida; Mike Coffman in Colorado; Peter Roskam in Illinois; and Barbara Comstock in Virginia, among them.

Trump had also given shoutouts to lawmakers who requested — and received — his support before winning. He name-checked victorious Reps. Andy Barr of Kentucky, Mike Bost of Illinois and Rodney Davis of Illinois.

Those who didn't want the president around "did very poorly," Trump said.

Retiring Rep. Ryan Costello, R-Pa., fired back at Trump on behalf of his colleagues.

"To deal w harassment & filth spewed at GOP MOC’s in tough seats every day for 2 yrs, bc of POTUS; to bite ur lip more times you’d care to; to disagree & separate from POTUS on principle & civility in ur campaign; to lose bc of POTUS & have him piss on u," he wrote on Twitter. "Angers me to my core."

It wasn't just fellow Republicans who drew Trump's ire Wednesday, as he engaged in a series of testy exchanges with reporters from various news outlets, including NBC, at a free-wheeling press conference that ran for nearly an hour and a half.

Trump repeatedly blamed the media for sowing division in the nation, pitting reporters against other Americans, said he couldn't understand the accents of foreign reporters and accused National Public Radio's Yamiche Alcindor of asking "such a racist question" when she wondered whether white nationalists might be emboldened by his self-identification as a "nationalist."

Alcindor is black. Trump has defended his use of the term in the past by saying that he only means to distinguish himself from "globalists," who he says care more about other countries than the U.S.

The news conference wasn't entirely dominated by media clashes. When he was asked whether Vice President Mike Pence would be his running mate for the 2020 presidential campaign, Trump turned to Pence, who was in the audience, and asked if he would join the ticket. Pence quickly agreed.

The main lesson he learned from the midterms, he said, was "I think people like me."

Though Republicans lost control of the House Tuesday night, Trump portrayed the midterms as a "tremendous" success because the GOP picked up several Senate seats — against the headwinds of historical precedent.

He said Republicans in the House "dramatically over-performed" expectations. And he even framed the loss of the chamber as a victory for him.

"If we had the majority and we had one or two or three votes to play with we would have been at a standstill," he said. With Democrats in charge, he said, "we can do a tremendous amount of legislation."

But he also warned that if Democrats try to investigate him, Senate Republicans will do the same to them, producing a stalemate. And he said that he would not work with them on policy if they investigate his administration.

"If they do that then all it is is just a war-like posture," he said.