We may be winning the War on Terrorists, but increasingly we’re losing the terrorists we’ve captured on the battlefield, dooming us to fight them all over again.

The metric the Obama adminstration uses to measure success in the war is the number of al Qaeda operatives and other high-value terrorists killed or captured.

“Al Qaeda is on the path to defeat,” the president said last fall, “and Osama bin Laden is dead.” Obama also said the upper ranks of al Qaeda have been “decimated.”

But how many have escaped or been released from custody? Answer: far too many. And now our enemy is making a comeback.

US embassies are closed today across the Middle East, and travel alerts have been issued, because of threats from a resurgent al Qaeda.

That’s because, across the Muslim world, al Qaeda and even our own allies are springing terrorists from jail at an alarming rate. As they regain their freedom, they’re rejoining the jihad, forcing us to refight them another day.

Consider the following developments in:

IRAQ: Last month, al Qaeda busted out as many as 600 terrorists — including dozens of convicted al Qaeda leaders who’d received death sentences — from two prisons near Baghdad in what appears to have been simultaneous and well-coordinated attacks. Interpol issued a security alert over their escape, warning they pose “a major threat to global security.”

US authorities suspect al Qaeda had help from inside the prisons. The Iraqi government has showed leniency for imprisoned terrorists since taking over security from US forces. Last year, for instance, Iraqi authorities pardoned a Lebanese terrorist responsible for the kidnapping, torture and murder of several American military officers. Ali Mussa Daqduq was cleared of his crimes not long after Obama agreed to turn him over to the Iraqi government instead of locking him up at Gitmo.

LIBYA: Terrorists also pulled off a massive jailbreak last month in Benghazi, where US Ambassador Chris Stevens and three American security personnel were killed by al Qaeda operatives in a Sept. 11, 2012, attack on the diplomatic mission there. About 1,200 inmates — including suspected al Qaeda fighters and other Islamic militants — escaped from the Koyfiya prison and are still at large.

PAKISTAN: Also last month, Taliban fighters attacked a large prison in Dera Ismail Khan, using suicide bombers, mortars and grenades to knock out the prison’s power supply and blast through walls to free some 250 fellow terrorists.

Past jailbreaks have led to surges in terrorist activity. After al Qaeda members in 2006 escaped from a major prison in Yemen, it empowered the group to the point where its Yemen wing is now its most feared.

AFGHANISTAN: No such jailbreaks are necessary in Afghanistan, where the administration in its rush to retreat from this critical front in the war on terror has handed over control of US prisons to Afghan authorities.

All told, the US so far has transferred about 4,000 terrorist detainees to the Afghans, who in turn have freed at least 1,376 of them — including many former Gitmo alumni. In fact, most of the 46 Taliban prisoners repatriated from Gitmo already have been released. And as many US commanders warned, several have returned to the battlefield as high-level Taliban commanders leading attacks on US troops. They include Abdullah Ghulam Rasoul, Maulavi Said Khail, Maulavi Shaheer and Maulavi Raouf.

Despite the high recidivism rate, the administration plans by 2014 to turn over all its prisoners to the Afghan government — including high-value al Qaeda foreigners from Pakistan, Yemen and Saudi Arabia; and possibly even the 22 known suspects in insider attacks on our troops who have been captured. Since 2007, Afghan soldiers and police have launched at least 70 attacks on American troops, killing 92 and wounding another 134, according to an unclassified Pentagon report released last week.

The Obama administration is even sponsoring a de facto amnesty program for Taliban and al Qaeda fighters.

Through what is known locally as the Afghan Peace and Reintegration Program, the Pentagon is actually paying insurgent fighters to walk off the battlefield. All they have to do is sign an “intent to reintegrate” form vowing to “cease violence (and) live within the laws of Afghanistan;” and in exchange, they’ll receive monthly payments and even get to keep their weapons if they request them for “personal protection.” Local tribal leaders and clerics do the security vetting and vouch for their reintegration as part of a High Peace Council.

Since its 2010 launch, the program has enrolled 6,277 insurgents at a cost to US taxpayers of $72 million. Total five-year funding for the reintegration program is $175 million. The Pentagon has provided no data on the number of enrollees who have returned to the battlefield.

SAUDI ARABIA: A similar reintegration program we’ve entrusted the Saudis to run for Saudi terrorists released from Gitmo has been a disaster. By one account, the recidivism rate for its “jihad rehab” exceeds 40%. According to the Saudis themselves, some 25 of the 120 ex-Gitmo detainees repatriated to the kingdom have rejoined the jihad for a recidivism rate of 21%.

At least a dozen of these Saudi recidivists have reunited with al Qaeda in Yemen, taking high-ranking positions in al Qaeda in the Arabian Peninsula, which has launched attacks on the American homeland.

EGYPT: After now-deposed Egyptian President Mohammed Morsi took the reins of power in Cairo last year, with the backing of the Obama administration, he pardoned 572 suspected terrorists and militants, including 25 leaders of the Egyptian Islamic Jihad and Jama’a al-Islamiya. He even released a handful of terrorists the CIA had interrogated after 9/11 for ties to the plot.

Another prisoner Morsi freed in 2012 was none other than Mohammad Zawahiri, brother of current al-Qaida chief Ayman al-Zawahiri, who founded Islamic Jihad.

GITMO: Our own commander in chief is planning perhaps the biggest break for al Qaeda. Obama wants to shut down Gitmo and repatriate all but the 9/11 planners.

Already, nearly 30% of the 600 detainees transferred or released from Gitmo have re-engaged in terrorist activities, according to a recent Pentagon report. Emptying the prison is just asking for more trouble.

America has sacrificed trillions of dollars and thousands of lives putting all these bad guys behind bars. Now the brave work of our men and women in uniform is steadily being undone, ultimately putting the nation back on a dangerous pre-9/11 security footing.

Paul Sperry, a Hoover Institution media fellow, is author of “Infiltration” and “Muslim Mafia.”