It’s a loophole big enough to squeeze a pension through.

Joe Percoco, the disgraced former top aide to Gov. Andrew Cuomo, will be able to cash in once again on his time in government and collect his pension — despite three felony convictions on corruption charges.

Voters gave judges the authority in 2017 to strip government employees of their retirement checks if they’re nailed on felonies.

But the law only covers crimes committed after Jan. 1, 2018.

Percoco’s crimes date from 2012 through 2016.

Since the law isn’t retroactive, Percoco gets to keep his pension, which could be worth as much as $36,000 a year.

The story was first reported by the Syracuse Post-Standard.

Federal prosecutors in Manhattan convicted Percoco on three corruption counts stemming from pay-to-play schemes that netted him an estimated $300,000.

Jurors acquitted Cuomo’s former right-hand man of three other corruption charges at the conclusion of the seven-week trial.

Percoco’s sentencing is scheduled for June. He faces up to 50 years in prison.