KABUL (Reuters) - The Afghan government released 65 detainees on Thursday who the United States has warned pose a serious security threat, a move that is likely to inflame already strained U.S.-Afghan ties as the international mission in Afghanistan winds down.

Afghan Defense Ministry spokesman Zahir Azimi said the prisoners had been released from a detention facility near the Afghan capital, Kabul, and would be sent back to their respective home areas throughout Afghanistan.

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

"Detainees from this group of 65 are directly linked to attacks killing or wounding 32 U.S. or coalition personnel and 23 Afghan security personnel or civilians," the U.S. military's leadership in Afghanistan said in a statement on Wednesday ahead of the prisoners' release.

The detainees have become one more issue fueling tension in U.S.-Afghan ties, as foreign troops, who have been in Afghanistan since 2001, steadily withdraw.

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

(Reporting By Hamid Shalizi; Writing by Missy Ryan; Editing by Paul Tait)