WASHINGTON — Just last week, President Trump was on Twitter accusing FBI Director James Comey of being too soft on his election opponent, Hillary Clinton.

“FBI Director Comey was the best thing that ever happened to Hillary Clinton in that he gave her a free pass for many bad deeds!” Trump tweeted May 2.

A week later, Trump sacked Comey — but for the exact opposite reason. Moments after announcing Comey’s firing, the White House released a Justice Department letter that claimed Comey had inappropriately disparaged Clinton during the election campaign — and overstepped his bounds in publicly disclosing that he had reopened his investigation into the former secretary of State’s emails.

Only Trump knows the real reason for Comey’s firing.

But in his letter to Comey informing him of his dismissal, Trump issued what appeared a Shakespearean protestation: “While I greatly appreciate you informing me, on three separate occasions, that I am not under investigation, I nevertheless concur with the judgment of the Department of Justice that you are not able to effectively lead the bureau,” Trump wrote to Comey on Tuesday.

Indeed, Comey was leading to what appeared to be an open-ended investigation into Russian interference in the election — and what Trump associates knew about it. “The Russia-Trump collusion story is a total hoax, when will this taxpayer funded charade end?” Trump tweeted Monday.

But Comey’s firing will have the immediate effect of intensifying calls for an independent investigation to investigate that very question.

After all, Comey was thrust into the role of refereeing the 2016 election because political appointees in the Obama and Trump administrations had been seen as incapable of doing so.

Former attorney general Loretta Lynch was forced to recuse herself from the Clinton probe after an ill-considered meeting with former president Bill Clinton on an airport tarmac in Phoenix in the midst of the investigation into his wife’s emails.

Former deputy attorney general Sally Yates, an Obama holdover, was fired 10 days into the Trump administration — four days after she warned the White House that Trump’s first national security adviser, Michael Flynn, was susceptible to Russian blackmail.

And Trump’s attorney general, Jeff Sessions, also had to recuse himself after misleading Congress about his own contacts with the Russian government while he served as a high-profile supporter of Trump’s campaign.

So the political maelstrom Comey found himself in wasn’t entirely of his own making. Still, Comey did not shun the spotlight that came with those politically sensitive investigations, holding unusually expository press conferences and giving freewheeling congressional testimony.

If there were any doubt that Comey was a pivotal figure in the 2016 presidential election, his firing as FBI director Tuesday should settle the issue for the history books.

It’s a history that is still being written.

Read more:

President Trump fires FBI Director James Comey

5 key points in memo calling for FBI Director James Comey’s firing

Clinton officials respond to Comey firing with suspicion, not satisfaction

How did we get here? A James Comey timeline

Tweets fly fast and furious following firing of FBI head Comey

James Comey is one of several officials President Trump fired

Democrats call for independent Russia probe in wake of Comey firing