President Trump on Thursday attacked Robert S. Mueller III as “totally conflicted” and “a true never-Trumper” and claimed that the former special counsel would have brought charges against him if he had any evidence — a characterization directly at odds with what Mueller said in a public statement Wednesday.

Trump’s attacks came in morning tweets and later while speaking to reporters at the White House. In one of his tweets, he also seemingly acknowledged for the first time that Russia had helped him get elected in 2016 — but he strongly pushed back against that notion while talking to reporters as he prepared to leave Washington.

Mueller ended his role as special counsel on Wednesday and said his office could not consider whether to charge Trump with a crime because of a long-standing Justice Department opinion that a sitting president cannot be indicted. Mueller repeated a line in his report explaining that his team would have exonerated Trump if it could have.

Mueller’s public remarks were his first since concluding a nearly two-year investigation into Russian interference in the 2016 presidential election and whether Trump sought to obstruct the probe.

“Robert Mueller should have never been chosen,” Trump said. Mueller was appointed as special counsel by then-Deputy Attorney General Rod J. Rosenstein, a Republican Trump appointee.

Trump told reporters that he considered Mueller “totally conflicted” because he had discussions about the position of FBI director early in the Trump administration and is friendly with former FBI director James B. Comey, whom Trump fired in 2017.

“He loves Comey,” Trump claimed. “Whether it’s love or a deep like, he was conflicted.”

Associates of the two men have said they had a close professional relationship but did not socialize.

Trump also cited a “business dispute” with Mueller on which he did not elaborate. In the past, White House aides have pointed to an alleged dispute over membership fees at Trump National Golf Club in Northern Virginia.

While Trump has also criticized Mueller on previous occasions, at one point, before his report was publicly released, Trump replied “yes” when a reporter asked whether Mueller had done his job honorably.

Trump caused a kerfuffle earlier Thursday morning after seeming to acknowledge for the first time that Russia had helped him in 2016.

“Russia, Russia, Russia! That’s all you heard at the beginning of this Witch Hunt Hoax,” Trump wrote on Twitter. “And now Russia has disappeared because I had nothing to do with Russia helping me to get elected. It was a crime that didn’t exist.”

Shortly afterward, however, he told reporters at the White House that Russia had not helped him get elected.

“You know who got me elected? I got me elected,” he said. “Russia didn’t help me at all. Russia, if anything, I think, helped the other side.”

In his report, Mueller said the Russian interference efforts were aimed at hurting Democrat Hillary Clinton.

In his comments to reporters, Trump played down the prospect of impeachment. A growing number of Democrats were advocating that course on Wednesday after Mueller’s appearance.

“It’s a dirty, filthy, disgusting word, and it has nothing to do with me,” Trump said. “There was no high crime, and there was no misdemeanor.”

Speaking at the Justice Department on Wednesday, Mueller said his team found “insufficient evidence” to accuse Trump’s campaign of conspiring with Russia to tilt the 2016 election but emphasized that investigators did not make a similar determination on whether the president had obstructed justice.

Mueller said that if his office “had confidence that the president clearly did not commit a crime, we would have said so.” And he noted that the Constitution “requires a process other than the criminal justice system to formally accuse a sitting president of wrongdoing” — a reference to impeachment by Congress.

Because of the Justice Department opinion, Mueller said that “charging the president with a crime was therefore not an option we could consider.”

Hundreds of former federal prosecutors have opined that Mueller laid out sufficient evidence in his report to make an obstruction case against Trump.

In other tweets Thursday morning, sent before departing for Colorado, where he is scheduled to address a U.S. Air Force Academy graduation ceremony, Trump defended his aggressive pushback against Mueller’s probe.

“So now the Dems and their partner, the Fake News Media, say he fought back against this phony crime that didn’t exist, this horrendous false accusation, and he shouldn’t fight back, he should just sit back and take it,” Trump wrote. “Could this be Obstruction? No, Mueller didn’t find Obstruction either. Presidential Harassment!”

Trump returned to Twitter several hours later and continued opining on the Mueller investigation.

He said the Mueller had come to the Oval Office in 2017 with an interest of returning to his previous job as FBI director.

“I told him NO,” Trump wrote. “The next day he was named Special Counsel - A total Conflict of Interest. NICE!”

According to Mueller’s report, former White House strategist Stephen K. Bannon testified that he told Trump his purported conflicts with Mueller were “ridiculous,” including his claim about the FBI job. Bannon said that the White House invited Mueller to speak to Trump to offer perspective on the institution he formerly led and that Mueller did not come looking for the job.

Later Thursday, Trump tweeted a graphic showing Mueller walking out of the briefing room at the Justice Department on Wednesday and a much large image of himself waving. “CASE CLOSED.”

In tweets late Wednesday and early Thursday, Rudolph W. Giuliani, Trump’s personal attorney, also took aim at Mueller.

Giuliani said Mueller’s public statement “was halting and stumbling which demonstrated why he doesn’t want to testify” to Congress about his report.

“But still the same conclusion: no case,” Giuliani wrote. “Mueller proved he was as biased as his staff.”

Matt Zapotosky and Devlin Barrett contributed to this report.