Former FBI director James Comey made a major mistake at his hearing at the Senate Intelligence Committee on Thursday when he revealed that he had deliberately leaked a memorandum of a conversation with the president because he “thought that might prompt the appointment of a special counsel.”

Aside from the legal jeopardy that Comey may face as a result of having leaked a government document as a private citizen, Comey has now undermined Special Counsel Robert Mueller’s investigation by revealing it to be a deliberate political setup.

Earlier in the hearing, Comey had praised the special counsel as a critical tool to discover the truth about Russian interference in the 2016 presidential election: “Understanding what efforts there were or are by the Russian government to influence our government is a critical part of the FBI’s mission, so — and you’ve got the right person in Bob Mueller to lead it,” he said.

But later, Comey said that he had hoped to “prompt the appointment of a special counsel” for reasons that had nothing to do with Russia. Comey leaked his memo, he said, so that he could corroborate claims by aides that he told them Trump had asked for his “loyalty.”

The Times reported those leaked claims on May 11, and Trump denied them the following day, accusing Comey of leaking to the press. Three days later, Comey told the Senate, he remembered the memo and leaked it.

He knew Trump was not under investigation for ties to Russia — a fact he refused to divulge publicly — but pushed for a special counsel to be appointed because he wanted to take revenge on the president. He leaked through Columbia Law School professor Daniel Richman, who approached the New York Times. (It was a left-wing trifecta: a former government bureaucrat, an Ivy League academic, and a liberal mainstream media outlet.)

Moreover, the special counsel that was appointed was — coincidentally? — one of Comey’s long-time associates, the FBI director when Comey was Deputy Attorney General.

“For Mueller to be brought in to investigate the behavior of the guy who sacked Comey seems a conflict of interest,” wrote Carl M. Cannon of RealClearPolitics. “These two guys, working in tandem, have a track record of bureaucratic infighting — with another Republican White House as their shared adversary — that belies their reputations for being above political intrigue.”

Comey did not have to tell the Senate Intelligence Committee that he had leaked his memo to the press to make sure a special counsel was appointed. He could have just told the hearing that he had wanted to set the record straight. That might have led to questions about why he had not waited to testify before revealing the memo, but he could have said he was worried about Trump exerting executive privilege to block it.

Instead, Comey blurted out the truth: he had seen a chance to make the political case for a special counsel through the power of the mainstream media.

Suddenly, the motive behind Comey’s bizarre pattern of behavior over the past year is obvious. Comey went along with former Attorney General Loretta Lynch’s request to hide the criminal investigation into Hillary Clinton, and later made the extraordinary recommendation not to prosecute her, because he did not want the public to blame him or the FBI for destroying her election prospects. When she seemed certain to win, in late October 2016, he feared Republicans might blame him for ensuring her victory, and so he re-opened the Clinton investigation in a public way. He probably never imagined that she would lose: he simply wanted to be able to avoid blame for her win.

Then, once the impossible happened, Comey was scapegoated by the media and the Democratic Party for Clinton’s loss. So he made sure that President Trump was dogged by false allegations, and later set in motion a process that made Trump’s removal from office possible, setting himself up as the hero. At all times, he justified his actions, to himself and to the public, by claiming he was protecting the integrity of the FBI, which he was in fact destroying it.

Comey clearly wanted credit for the appointment of the special counsel. But his admission that he manipulated the media — and the evidence — to win a political fight with Trump undermines the justification for that appointment.

Mueller was not appointed to find the truth about Russia, but to bring down the Trump presidency.

Nothing Mueller does can be taken at face value any longer, and every action he takes will be clouded by political suspicion. He should be dismissed and replaced by an independent, bipartisan commission. Otherwise the truth will never be known, or trusted.

Joel B. Pollak is Senior Editor-at-Large at Breitbart News. He was named one of the “most influential” people in news media in 2016. He is the co-author of How Trump Won: The Inside Story of a Revolution, is available from Regnery. Follow him on Twitter at @joelpollak.