William F. B. O'Reilly Portrait of Newsday/amNY columnist Bill O'Reilly (March 28,

William F. B. O'Reilly is a consultant to Republicans.

James Comey has been explaining himself for almost a year.

But in the end, his inconsistent handling of FBI investigations into Hillary Clinton’s emails and the Donald Trump campaign’s possible collusion with Russian agents never sat right, not with anyone remotely impartial.

Maybe history dealt the former FBI director a bad hand; maybe he did what he thought was right at each bizarre card turn of the 2016 election, but Comey’s bungling of Senate testimony last week — the FBI had to retract misstatements about Huma Abedin and her estranged husband, former Rep. Anthony Weiner — was the final blow to his reputation. Once again Comey was left having to explain himself. Once again he and the FBI were made to look ridiculous. As the movie producer character Jack Woltz of “The Godfather” fame said: The FBI can’t afford to be made to look ridiculous.

It’s clear Comey had to go.

At the same time, Trump’s dismissal of Comey rightly sets off alarm bells. A president firing an FBI director leading an investigation into members of that president’s campaign team will do that. Trump’s flair for the dramatic, firing Comey without notice and in the middle of an evening news cycle, didn’t help. Neither did CNN’s report hours after the firing that federal prosecutors under Comey’s command had just issued grand jury subpoenas in the Russia probe, or Wednesday’s stories by The Washington Post and The New York Times that the FBI had asked for more resources for its probe of Russian meddling in the presidential election days before the director was dismissed.

Comey’s removal clears the path for a special prosecutor to be appointed. One is easily in order. The public needs to know definitively whether there was coordination between the Trump campaign and Russian agents. The seriousness of such an accusation demands every possible protection from partisan interference. There shouldn’t be a whiff of partiality.

Comey’s tenure at the FBI this past year exposed what such partisanship can look like. His myriad statements have twisted lock-step Democrats and Trump Republicans into pretzel-like forms as they’ve alternatively loved, hated, loved, then hated the director on any given day, depending on his announcement du jour. Democrats who blasted Comey for his handling of the Clinton email scandal are his ardent defenders today; Trump supporters who sang Comey’s praise before and after the election are now throwing him under the bus.

advertisement | advertise on newsday

It’s impossible to know what really motivated Trump to fire his former FBI director. But if he appoints one who’s an obvious Trump campaign loyalist, it’s going to look very, very bad for this administration.

The president would be wise, instead, to name an independent prosecutor to look into Russia’s activities during the election — and to order him or her to pursue the accusations as thoroughly and quickly as possible. That’s the only way this country is going to move through the lingering stench of 2016.

If there’s truly nothing for the president to worry about, and I hope that’s the case, appointing a special prosecutor is the obvious course of action.

William F. B. O’Reilly is a consultant to Republicans.