With just 2½ months remaining in his term, President Obama has arrived at what many intelligence officials believe is an “irreducible minimum” number of Guantanamo Bay prisoners who can’t be transferred because they’re considered too dangerous, or their home countries like Yemen are too unstable to repatriate them.

But that hasn’t stopped the president from trying to whittle down the terrorist population at the prison even further in his quest to permanently shutter it.

During his time in office, Obama has slashed the number of detainees from 241 to just 60. Of those, 20 are queued for release, leaving 40 who are considered the worst of the worst terrorists, including 9/11 co-conspirators.

The recidivism rate of the Muslim men previously released is high. Almost 1 in 3 has returned to violent jihad. Freeing or transferring the remaining prisoners to less secure facilities is exceedingly risky.

Obama himself noted seven years ago that these otherwise “forever detainees” pose a “clear danger to the American people.”

The terrorists in this high-risk category, he explained, “received extensive explosives training at al Qaeda training camps, or commanded Taliban troops in battle, or expressed their allegiance to Osama bin Laden, or otherwise made it clear that they want to kill Americans.”

So how will the president fulfill his campaign vow to close the prison while making it appear he’s not further jeopardizing national security? One way is lowering the standards his parole board uses to assess the continuing threat prisoners pose to America.

Take Moath Hamza Ahmed al-Alwi, an al Qaeda fighter from Yemen who served as a bodyguard for bin Laden in Afghanistan before 9/11. His case is up for review before the board now, along with three other Yemeni nationals. His intelligence file warns he “has made several statements since early 2016 that suggest he maintains an extremist mindset.” It also notes al-Alwi has committed a number of disciplinary infractions at Gitmo, including threats against guards.

However, under a new policy, his infractions were “pardoned at the start of Ramadan as part of an incentive for detainees to improve their conduct,” according to a recently declassified document. So suddenly, al-Alwi appears before the parole board with a record of good, not bad, behavior.

Normally, detainees who, as Obama said, make it “clear they want to kill Americans” have no chance at parole. But that didn’t stop the parole board he set up — the so-called Periodic Review Board — from clearing al Qaeda commander Muhammad al-Rahman al-Shumrani for release earlier this year.

Despite proclaiming, “When I get out of here, I will go to Iraq and Afghanistan and kill as many Americans as I can,” al-Shumrani was transferred to his native Saudi Arabia.

The board has become increasingly lenient as White House pressure to empty Gitmo mounts.

In 2014, for example, it decided after hearing the case of detainee Fayez al-Kandari that the al Qaeda recruiter and bin Laden aide was too dangerous to transfer. But suddenly in 2015, the board made an about-face, claiming that Kandari had “demonstrated a willingness to examine his religious beliefs and engaged more openly with the board.” He was deemed no longer a threat and transferred to Kuwait.

As The Post has reported over the past year, hard-core al Qaeda terrorists, including bin Laden bodyguards, have been kicked from custody on the flimsiest of excuses. Sympathetic parole board members have been impressed with their sob stories of wanting to return home to the Mideast to care for their sick mothers. Or their sudden ambition to give up jihad and work on “milk and honey farms,” or plant flowers and arrange them for weddings.

Obama knows it’s a dumb bet to trust these killers. His own intelligence czar reported in September that 213 of the 693 detainees released from Gitmo have joined anti-US terror groups. That means 31 percent have gone back to fighting against us, some with deadly results. The recidivism rate is much higher if you include those known to have communicated with terrorists or made anti-US propaganda statements after release.

Even Democrats have expressed security fears over closing Gitmo, and have joined Republicans in blocking Obama’s efforts. The president now faces the option of acting unilaterally and forcing the prison’s closure through executive action — and moving the prisoners to US soil despite widespread opposition.

In his remaining days in office, we will see if Obama puts securing his political legacy among antiwar leftists above the security of the nation.

Paul Sperry is the author of “Infiltration.”