The Afghan president's office says a judicial panel has ruled that administrative detention runs counter to the country's laws, potentially thwarting a U.S. plan to hand over Afghan detainees that American officials believe should continue to be held without recourse to a trial.

The president's office says in a statement issued Monday that the detention of Afghan citizens without a court trial "has not been foreseen in Afghan laws."

The United States has agreed to hand over all Afghan detainees captured in the country to the national government, but has also argued that it cannot risk the release of some high value detainees to the notoriously corrupt Afghan court system. Even though the deadline for the handover has passed, the Americans are still holding more than 600 Afghans.