In the middle of a meandering speech, Trump said that he had recently had “a great conversation with President Obama,” a mention that elicited boos from a crowd packed into a 10,000-seat arena here.
Trump first started to tamp down the reaction but then turned his attention to Earnest.
“This foolish guy, Josh Earnest, I don’t know if he is talking to President Obama,” Trump said. “You know, having the right press secretary is so important, because he is so bad, the way he delivers a message.”
“He can deliver a positive message and it sounds bad. He could say, ‘Ladies and gentleman, today we have totally defeated ISIS,’ and it wouldn’t sound good,” Trump said, referring to the Islamic State terrorist organization.
On the subject of defeating ISIS, Trump added: “I have a feeling they won’t be saying it, but I know we will be saying it.”
The White House did not immediately reply to a request for comment.
Trump’s comments come as Earnest has said in recent days that Trump knowingly benefited from Russian involvement in the U.S. election and encouraged hacking in his victory over Clinton.
“It is just a fact — you all have it on tape — that the Republican nominee for president was encouraging Russia to hack his opponent, because he believed that would help his campaign,” Earnest told reporters on Thursday. “It is not a controversial statement. I'm not trying to be argumentative. But I am trying to acknowledge a basic fact.”
Trump has voiced skepticism about the Russian government being involved in hacks of Democratic email accounts.
Much of Trump’s address Thursday was devoted to recounting news coverage of his election night victory. The president-elect mocked many of the television reporters and pundits involved. He said at one point CNN anchor John King looked like he was “getting ready to throw up” as he relayed the results.
Trump became the first Republican to carry Pennsylvania since 1988. He thanked his audience, but said that because it took so long for the news media to declare him the winner, “we didn’t even need you guys.”
Trump sought to end the night on a unifying note, saying he wants to “heal our divisions and unify our country.”
“My message tonight is for all Americans, from all parties, all beliefs, all walks of life,” Trump told a largely white audience. “Whether you are African American, Hispanic American or Asian American or whatever the hell you are, remember that we are all Americans and we are all united by one shared destiny.”
Juliet Eilperin contributed to this report.