KABUL, Afghanistan — Despite American protests, the Afghan government has issued formal release orders for 37 prisoners who are regarded by the NATO-led coalition as dangerous insurgents responsible for the deaths of Americans and Afghans. The release orders set the stage for a renewed confrontation between President Hamid Karzai and the United States.

The Americans say there is enough evidence to prosecute the men, who are being held at what was once the main American prison in Afghanistan, at Bagram. But Afghan officials appear determined to release as many detainees as possible. Mr. Karzai called the prison a “Taliban-making factory” over the weekend, and told reporters, “God willing, I will close Bagram.”

American officials received that message on Sunday when they were told by Afghan officials that formal orders to release the 37 detainees had been issued last week, a senior American military official said. The step was not a surprise — Mr. Karzai gave instructions this month to proceed with the releases — but it prompted the American military command to renew its public fight to stop the process.

In a statement issued on Monday before the Afghan authorities could make their own announcement about the release orders, the Americans called the plan “a major step backward in further developing the rule of law in Afghanistan.” It said the Afghan authorities would be “releasing back to society dangerous insurgents who have Afghan blood on their hands.”