Five years ago, candidate Barack Obama repeatedly said that if elected president he would shut down the U.S. detention facility for terror suspects at Guantanamo Bay, Cuba.

In his news conference on Tuesday, President Obama said that again.

So in his nearly 4½ years in the White House, why hasn’t Mr. Obama already fulfilled that familiar pledge?

Because Congress, on a bipartisan basis, has rightly passed several measures to stop him from doing so.

Simply put, since late 2001 the United States has captured lots of dangerous terrorist suspects who shouldn’t be housed on our soil — and who don’t deserve constitutional protections.

Yet in response to a reporter’s question about the prison established by the Bush administration soon after 9/11, President Obama said Monday:

“I continue to believe that we’ve got to close Guantanamo.”

Asserting that the facility “is not necessary to keep America safe,” he added: “It is expensive. It is inefficient. It hurts us in terms of our international standing. It lessens cooperation with our allies on counterterrorism efforts. It is a recruitment tool for extremists.”

And: “It’s easy to demagogue the issue. That’s what happened the first time this came up. I’m going to go back at it because I think it’s important.”

But it’s not demagoguery to recognize that the transfer of the Guantanamo terror detainees to the U.S. would raise the risks of other terrorists launching attacks on or near the facilities where they are held.

As for the president’s contention that Guantanamo is a “recruiting tool for extremists,” only the extremely naive imagine that closing it would minimize Islamist zealots’ ongoing efforts to enlist like-minded killers in their jihad against the U.S.

President Obama also contended Tuesday that we now “should be wiser” in how “we prosecute terrorists.”

Hmm. Keep in mind that Attorney General Eric Holder, with the president’s blessing, wanted to try confessed 9/11 mastermind Khalid Sheikh Mohammed in a federal criminal court in Manhattan.

How wise was that?

Even many influential Democrats, including New York Sen. Charles Schumer, objected to that absurd idea — and helped force the administration to try KSM in a military tribunal at Guantanamo instead.

Yes, the indefinite detention of some Gitmo prisoners without trial raises serious questions about fairness.

However, the extraordinary threat posed by our enemies in what remains America’s war on terror — despite the Obama team’s reluctance to call it that — demands extraordinary measures.

President Obama should know the harrowing scope of that enduring terror menace by now.

He also should know that it’s time to give up his stale pitch about closing Guantanamo.