The FBI probe of Hillary Clinton took a major step forward this week with news that the guy who ran her illicit home-brew email has been granted immunity.

Clinton aide Bryan Pagliano had invoked his Fifth Amendment rights in refusing to testify or cooperate with investigators.

A tech with the 2008 Clinton campaign, he got hired for related duties when she took over at State — then won the nearly $140,000-a-year side job of setting up and maintaining her private email system.

Former top-notch federal prosecutor Andy McCarthy says the grant of immunity strongly suggests that either a grand jury has already been empaneled to consider charges in this case — or that the feds expect to empanel one soon.

So much for Clinton’s claim that this is a perfunctory investigation in which she has nothing to fear criminally.

Sorry, Madam Secretary, the FBI doesn’t “perfunctorily” grant immunity. And the probe is apparently in the hands of career national-security prosecutors, including one from the team that won a guilty plea from former CIA chief Gen. David Petraeus.

You begin to see why she’s refused to hold a press conference for three months now.

It’s not just Clinton at risk here: Top aides such as Huma Abedin and Cheryl Mills were also clearly involved in the improper handling of the nation’s secrets. Indeed, the FBI’s reportedly looking into whether aides traded passwords to illegally move info from classified servers to the private system.

We already know that more than 2,000 Clinton emails contained classified information, including dozens with the most confidential stuff. At issue is who’ll take the fall for improper handling of the secrets.

Be glad the FBI’s on the case. The State Department has announced that its investigation won’t wrap up ’til after Election Day.

Clearly, Clinton still has powerful fans at Foggy Bottom. But how many does she have at the Justice Department?

President Obama has publicly claimed there’s no scandal here — a signal of where he wants the FBI investigation to lead.

If the nonpolitical attorneys move to file charges anyway, do they get quashed? If so, how many will resign in public protest?

We’d like to think the legal system could honestly resolve this case — but it’s most likely to come down to politics.