A detainee at the Parwan detention facility near Bagram Air Field is seen in a March 2011 file photo. (Dar Yasin/AP)

The Afghan government said Thursday it will release 72 high-profile detainees, a decision that defies pleas by U.S. officials and deals a massive blow to U.S.-Afghan relations just as the two countries attempt to complete a long-term security agreement.

U.S. officials say the prisoners pose a threat to both Afghan security and American service members based here, claiming their exoneration proves not only the dysfunction of the Afghan judiciary, but also the government’s inability to cooperate on even the gravest matters.

President Hamid Karzai declared Thursday that the evidence against the 72 men — which had been collected by both the Afghan intelligence service and the U.S. military — was insufficient to warrant formal trials, according to a statement from the presidential palace.

The release, which is expected within days, was ordered after a “thorough and serious review of the prisoners,” the statement said.

In an attempt to keep the detainees behind bars, U.S. officials had handed over reams of evidence against them — enough, they said they assumed, to at least justify formal trials.

But presidential spokesman Aimal Faizi said Karzai and a panel of senior officials had decided that was not the case. “The Americans didn’t have any proof against them,” Faizi said.

Bilateral relations, tense before the prisoner release, are expected to worsen, casting doubt on a pact that would permit U.S. troops to remain in Afghanistan beyond this year.

During a visit to Kabul last week, Sen. Lindsey O. Graham (R-S.C.) said the release “would have an unbelievably negative impact” on U.S.-Afghan relations and would prompt “a backlash in the U.S. Congress.”

U.S. military officials said at the time that the decision would fly in the face of a 12-year effort to bolster the Afghan legal system. Last March, the United States transferred control of the Parwan prison next to Bagram air base — with its roughly 3,000 detainees — to the Afghan government, a move intended to show confidence in the Afghan judiciary. Since then, the Afghans have released at least 560 detainees without trial.

“Release of these individuals by the Afghan Review Board undermines Afghan rule of law, because the Afghan people do not get their day in court,” said Col. David Lapan, a spokesman for the U.S.-led International Security Assistance Force.

Karzai officials said the Afghan president was not concerned with the Bilateral Security Agreement when he chose to release the 72 prisoners.

“They are two separate issues,” Faizi said. “The BSA is one issue. But the Afghans detained illegally is another issue. It’s not something we can allow to happen.”

Faizi said the American evidence that Karzai deemed insufficient included fingerprints on Kalashnikov rifles and confessions and accusations by other detainees.

“In the countryside, in almost every house you can find a Kalashnikov,” he said. “It’s not enough to keep someone in detention.”

The 72 prisoners slated for release were part of a group of 88. The other 16 will face trial in the coming weeks. Collectively, U.S. officials said, those 88 men killed 60 members of the U.S.-led coalition. They added that many detainees previously released by the Afghans have returned to the battlefield.

The prisoner release was announced just as news of the war’s most recent civilian casualty began to circulate. A 4-year-old boy was shot and killed by U.S. Marines on an operation in southern Helmand province, according to Omar Zowak, a spokesman for the provincial government.

ISAF acknowledged the casualty but declined to provide further details.

“We have always stood against civilian casualties and called for an absolute end to U.S. military operation at homes and Afghan villages,” Faizi said. “We condemn the killing of this innocent child.”

Sayed Salahuddin and Mohammad Sharif contributed to this report.