American officials have disputed the Afghan interpretation of the agreement to hand over the prison, arguing that the American military authorities have veto power over who is released. To date, Americans have not transferred all of the Afghan prisoners they are holding to government control. In addition, newly captured Afghan prisoners are being kept in American custody, a procedure the Afghans have disputed.

In the last year, 570 detainees have been released after acquittal in Afghan courts. An additional 485 are in the process of being released, or have been released already, after a bilateral board of Afghans and Americans determined that there was not enough evidence to prosecute them. On Saturday, the government expects to release 131 more prisoners.

Some Western officials believe that the move by the Afghan government is designed to encourage reconciliation with insurgents to help put an end to the war. And by timing the move on the day before Mr. Karzai leaves for Washington to visit President Obama, it also highlights his independence as a leader.

“The main reason behind the release of these prisoners is to show the good intentions of the Afghan government,” General Farooq said. “We hope that their release will strengthen peace and stability in the country.”

Judging by the response of families and friends of the prisoners, the government’s move was well calculated.

“The release of these prisoners will definitely have a positive impact on people’s relationship with the government,” said Haji Sangeen, 48, a truck driver from Paktia who came to collect 12 of the detainees who hailed from his village. “It will bring the distance between the government and people to a minimum.”

The released prisoners, for their part, were pleased with the result, if not their detention.

Mohammed Naib, 15, from Logar Province, said he was arrested during a night raid at his school when he was just 13.