And when will you be citing this law that says you cannot detain an unlawful combatant for the duration of the war?
It's not quite that simple...
The Laws of War state that belligerents can detain Prisoners of War. It further states that protected persons can be detained, only if it is absolutely necessary for the security of the occupying power. Finally, the Laws of War require the occupying power to impose their civilian laws on the occupied territory.
Under the Laws of War those that can legally take part in hostilities are limited. Anyone other than permitted combatants are therefore civilians, and if they attempt to take part in hostilities without first joining a permitted combatant group, they are committing criminal acts.
In accordance with the Laws of War criminal activities by civilians are to be handled by the laws of the occupying power, who has a duty to impose law and order on the occupied territory. If, under the laws of the occupying power, it is illegal to detain someone indefinitely without charge, the occupying power cannot legally detain a criminal civilian indefinitely without charge.
Under US law, it is illegal to detain a suspected criminal indefinitely without charge. therefore it is illegal for the USA to detain a suspected criminal indefinitely without charge. Therefore it is illegal for the USA to detain an unlawful combatant indefinitely without charge.
In terms of specific laws, from the Laws of Armed Conflict aspect you're looking at Hague IV (1907), POW Convention (1929), Geneva III (1949) and Geneva IV (1949).
I am not up to scratch on the specifics of US law, but I believe the primary relevant one is the US Constitution, specifically the Fourth Amendment.
On a final note, many of those detained at Guantanamo Bay were not captured in Afghanistan at all, but in other neutral countries. Hague V forbids this, as do various international laws regarding extradition.
Not the part related to the 9/11 attacks.
The 9/11 Attacks were a
crime not an act of war.