The Afghan government has released 65 detainees who the United States has warned pose a serious security threat.

Afghan Defence Ministry spokesman Zahir Azimi said the prisoners had been released from a detention facility near the capital, Kabul.

He said they would be sent back to their respective home areas throughout Afghanistan.

The US embassy in Kabul called it a "deeply regrettable" move that ran counter to a 2012 agreement on detainees.

"The Afghan government bears responsibility for the results of its decision," the embassy said in a statement on its website.

The US military has said the men should be tried in Afghan courts.           

A US military official said the United States had provided Afghan officials with "hundreds of pages" of evidence or investigative leads against the prisoners.

Some of the detainees, he said, had been linked by fingerprints or other evidence to the production or placement of improvised bombs.

The prisoners were transferred to Afghan authority last year as part of the US and NATO transition out of Afghanistan.

The coalition of foreign forces has been battling the Taliban since the Islamist group was removed from power in 2001.

The fate of another 23 prisoners who the United States contends should not be released is being examined by the Afghan government, the US official said.

The detainees have become one more issue fuelling tension in US-Afghan ties ahead of a presidential election in April and the planned pullout of most foreign troops by the end of the year.

The Obama administration has been pressing Afghan President Hamid Karzai for months to sign a bilateral security agreement with Washington that would allow some US troops to stay beyond the end of this year.