The U.S. military freed about 80 Afghan prisoners Sunday, and the country's most senior judge said the government was negotiating the release of hundreds more from American custody.

Two buses brought the prisoners from the main U.S. base at Bagram to the Supreme Court in the capital, Kabul (search), where they were received by Afghanistan's chief justice.

Fazl Hadi Shinwari congratulated them on their freedom and told them to be grateful to return to their families for the Muslim holiday feast of Eid al-Adha, which begins Jan. 20.

"Don't sabotage the security or the government and God will be pleased with you," the white-bearded cleric told the men.

An aide to president Hamid Karzai said on condition of anonymity that the prisoners were held either at Bagram, a U.S. base in the southeastern city of Khost or in the southern city of Kandahar. Court officials initially announced the men were from the U.S. jail at Guantanamo Bay, Cuba but later said they were mistaken.

U.S. and allied Afghan forces have captured thousands of suspected Taliban and Al Qaeda members in Afghanistan during and since the bombing campaign that ousted the repressive Taliban regime in late 2001.

Hundreds of detainees have been classified as "enemy combatants" and transferred to the prison at the U.S. naval base at Guantanamo, while many others have been held at American bases in Afghanistan.

The U.S. military has suggested it is minimizing detentions, and a reconciliation program to be organized by Karzai's government could reduce the numbers further.

Shinwari said the release of the 80 Afghans was part of that program, and Afghan officials were negotiating the release of another 400 people in U.S. custody in Afghanistan and an undisclosed number held in Guantanamo.

"The government doesn't want one prisoner to be left in jail," he told reporters at the court. "They will be released."

Karzai repeatedly has called on former Taliban supporters to make their peace with the new Afghanistan and throw themselves into the effort to rebuild the conflict-plagued country in return for freedom from prosecution.

U.S. commanders are promising not to arrest former low-ranking Taliban who come forward and are pressing Karzai to finalize a list of fugitive leaders who security forces will continue to try to kill or capture.

U.S. military officials in Kabul had no comment on Sunday's release.