Firing the US intelligence community’s inspector general is a big deal. I should know. I was a former longtime Central Intelligence Agency official who blew the whistle on the Clinton White House and agency bosses. Even so, I believe President Trump’s firing last week of IC Inspector General Michael Atkinson was appropriate — indeed, overdue.

Liberals and their media allies are predictably framing the firing as ­retaliation for Atkinson’s decision to inform Congress about a complaint by a so-called whistleblower that set off the Democratic effort to impeach the president. That’s false. Let’s review the facts.

On Sept. 9, 2019, Atkinson wrote to Congress that he had received an “urgent” whistleblowing complaint, which then-Acting Director of National Intelligence Joseph Maguire was refusing to forward to lawmakers. This complaint, of course, had to do with President Trump’s now-notorious call with his Ukrainian counterpart.

But Atkinson was out of line. Maguire initially refused to forward the complaint because the Justice Department had determined that it was outside Atkinson’s jurisdiction. The complaint didn’t involve “intelligence activity” — an important threshold ­requirement, unless we want our spies to treat the policy and political activities of our elected officials as within their purview.

Justice also rapped Atkinson on the knuckles for ignoring “arguable political bias on the part of the complainant in favor of a rival political candidate.”

The complainant had huge political bias problems, in fact. ­Before he sent his complaint to ­Atkinson, the CIA “whistleblower” brought it to a Democratic staff member on the House Intelligence Committee. He refused to meet with Republican members or staff to discuss it, even after it was ­released. Atkinson conceded to House members in early October that the complainant had “a professional tie” to Joe Biden.

The New York Times revealed on Oct. 2 that House Intelligence Committee Chairman Adam Schiff learned about the CIA officer’s complaint when the officer brought it to the committee in early August — belying Schiff’s earlier claims that he didn’t know about the complaint before his committee was ­informed about it on Sept 9. This was a political hit job.

Worse, Atkinson refused to ­explain why a form for filing IC whistleblowing complaints was changed to drop a requirement that complainants have firsthand knowledge of alleged wrongdoing. The anti-Trump complaint was based on hearsay.

Then, too, GOP members of the House Intelligence Committee claim Atkinson made false statements about the “whistleblower” and his complaint during classified interviews. This can’t be verified, because Schiff refuses to release the transcript of these interviews. GOP lawmakers are investigating Atkinson for the way he handled the complaint and his alleged false statements to the committee, per ranking member Devin Nunes.

It’s also telling that instead of accepting that he was a political appointee serving at the pleasure of the president, Atkinson ­denounced Trump for firing him, saying in a statement: “It is hard not to think that the president’s loss of confidence in me derives from my having faithfully discharged my legal obligations as an independent and impartial ­inspector general.”

Presidents shouldn’t fire IC ­inspectors general willy-nilly. But by referring a hearsay complaint to Congress, Atkinson committed a cardinal sin for an intelligence officer — he meddled in domestic politics. The CIA officer had raised a policy disagreement, not intelligence-related misconduct or abuse. Moreover, given the officer’s record of partisanship and the timing of his complaint, Atkinson should have known this individual clearly wasn’t a good-faith whistleblower: He was a partisan operative trying to help congressional Democrats manufacture a case for impeachment.

This is the type of misconduct that leads ordinary citizens to lose faith in what should be the impartial professionalism of the intelligence community.

Through incompetence, politics or both, Michael Atkinson’s actions set off the Democratic impeachment circus that for months distracted our government from legitimate duties — not least, defending our nation from the novel coronavirus pandemic. Trump’s dismissal of such an unprofessional inspector wasn’t merely justified — it was obligatory.

Fred Fleitz, a former executive secretary of the National Security Council under President Trump, was a CIA analyst from 1986 to 2005. Twitter: @FredFleitz