CNN  — 

The ISIS-K suicide bomber who carried out a terrorist attack at Kabul international airport in late August, killing 13 US service members and dozens of Afghans, had been released from a prison near Kabul just days earlier when the Taliban took control of the area, according to three US officials.

Two US officials, as well as Rep. Ken Calvert, a California Republican who said he had been briefed by national security officials, said the suicide bomber was released from the Parwan prison at Bagram air base. The US controlled the base until it abandoned Bagram in early July. It had turned over the prison to Afghan authorities in 2013.

The revelation underscores the chaos around the final days of the withdrawal from Afghanistan and the struggle of the US to control a rapidly deteriorating situation around the airport as it relied on the Taliban to secure the perimeter of the airport.

The Parwan prison at Bagram, along with the Pul-e-Charkhi prison near Kabul, housed several hundred members of ISIS-K, as well as thousands of other prisoners when the Taliban took control of both facilities hours before taking over the capital with barely a shot fired in mid-August, a regional counter-terrorism source told CNN at the time. The Taliban emptied out both prisons, releasing their own members who had been imprisoned but also members of ISIS-K, which is the terror group’s affiliate in Afghanistan.

Eleven days later, on August 26, it was one of those prisoners who carried out the suicide bombing at Abbey Gate, killing the 13 US service members, including 11 Marines, one soldier and one sailor. They would be the last US troops killed in Afghanistan as part of America’s longest war.

As of Tuesday, one Marine injured in the attack remains in a serious but stable condition at Walter Reed Military Medical Center near Washington, the Marine Corps said in a statement. Another Marine is receiving care at a specialty facility, while 16 others are receiving outpatient treatment.

Two US officials confirmed attacker’s identity

ISIS-K took credit for the attack and named the suicide bomber as Abdul Rehman Al-Loghri. Two US officials confirmed the identity of the attacker. FirstPost, an English-language news site based in India, was first to report that he had been released from the Bagram prison.

The rapid transition from released prisoner to suicide bomber highlights the dangers Afghanistan could pose without a US military presence on the ground to monitor the latest developments in the country. Joint Chiefs Chairman Gen. Mark Milley said the threat from Afghanistan is currently lower than it was after the 9/11 attack, but he warned that conditions “could be set” for a reconstitution of al Qaeda or ISIS-K.

“It’s a real possibility in the not too distant future – six,12, 18, 24, 36 months that kind of timeframe – for reconstitution of al Qaeda or ISIS,” Milley said at Capitol Hill hearing last week, “and it’s our job now, under different conditions, to protect the American citizens against attacks from Afghanistan.”

Calvert, who serves as the ranking member of the House Appropriations Committee Subcommittee on Defense, represented one of those killed in the suicide attack, Marine Corps Lance Corporal Kareem Nikoui. In a statement released last month, Calvert said he was briefed by national security officials on the identity of the suicide bomber and his release from Bagram prison.

In the statement, Calvert said the “disastrous” handling of the withdrawal “led to a series of events that culminated with the tragic loss of life on August 26th outside of the Kabul airport. Thirteen Americans, including one of my constituents, were killed because of the poor judgement and execution of our troop withdrawal.”

The Biden administration faced widespread criticism for its withdrawal from Bagram, not only because of the decision to abandon a sprawling military complex that was the heart of the US military operations in Afghanistan for nearly 20 years, but also for the way in which it was done.

Some Afghan officials said the US left the base in the middle of the night with little warning. The Pentagon insisted there had been communication and coordination about the handover of the base about 48 hours before the US left, but that the exact time of the final departure from Bagram was never given to the Afghan government.

Majority of Bagram prisoners were terrorists

The US handed Bagram Air Base over to the Afghan National Defense and Security Forces (ANDSF) on July 1, as the withdrawal of US forces from Afghanistan neared 90% completion.

At the time, there were approximately 5,000 prisoners at Bagram, an Afghan Ministry of Defense spokesman told CNN. A few hundred were criminals, but the vast majority were terrorists, the spokesman said, including members of al Qaeda, the Taliban, and ISIS. There were also foreign prisoners from Pakistan, Chechnya, and the Middle East detained there. It was up to the Afghans to secure the compound.

As the US was turning over Bagram to the ANDSF, the Taliban accelerated their sweep across the country, claiming to control 150 of Afghanistan’s 407 districts by July 5. It was a sign of things to come, as provincial capitals began falling to the Taliban offensive in rapid succession. By mid-August, the Taliban were on the doorstep of Kabul and the complete collapse of the Afghan military was virtually complete.

On August 15, the day former Afghan President Ashraf Ghani secretly fled the country, the Taliban reached the capital city, taking control of Bagram air base and the Pul-e-Charkhi prison facility.

In releasing the prisoners, the Taliban introduced another threat into an already chaotic environment, just as thousands of Afghans rushed to Kabul international airport in an attempt to flee the country. Military officials warned of the possibility for an attack at the airport and a threat from ISIS-K, and the State Department repeatedly cautioned American citizens to stay from the airport or certain gates.

The Taliban also viewed ISIS-K as an enemy, despite releasing some of their number from the prisons at Bagram air base and Pul-e-Charkhi.

Defense Secretary Lloyd Austin acknowledged in Capitol Hill hearings last week that the Pentagon was surprised by the collapse of the Afghan military within 11 days. But in his opening statements in the hearings, Austin defended the decision to leave Bagram.

“Retaining Bagram would have required putting as many as five thousand U.S. troops in harm’s way, just to operate and defend it. And it would have contributed little to the mission that we had been assigned, and that was to protect and defend our embassy which was some 30 miles away,” he said. “Staying at Bagram – even for counter- terrorism purposes – meant staying at war in Afghanistan, something that the President made clear that he would not do.”

CNN’s Katie Bo Lillis and Tim Lister contributed to this report.