Can you please provide some support for this assertion?
According to Article 5 of the Third Geneva Convention:
"Should any doubt arise as to whether persons, having committed a belligerent act and having fallen into the hands of the enemy, belong to any of the categories enumerated in Article 4, such persons shall enjoy the protection of the present Convention until such time as their status has been determined by a competent tribunal."
Additionally, in 1958, an International Criminal Tribunal quoted the following, in attempt to clarify the definition of an "unlawful combatant" (as the term is not specifically addressed by the Geneva Conventions):
"Every person in enemy hands must be either a prisoner of war and, as such, be covered by the Third Convention; or a civilian covered by the Fourth Convention. Furthermore, "There is no intermediate status; nobody in enemy hands can be outside the law," because in the opinion of the ICRC, "If civilians directly engage in hostilities, they are considered 'unlawful' or 'unprivileged' combatants or belligerents (the treaties of humanitarian law do not expressly contain these terms). They may be prosecuted under the domestic law of the detaining state for such action."
Additionally, this from Wikipedia:
"A combatant who does not qualify for POW status can, under the provisions of the Geneva Conventions, expect to be treated humanely; and before he is punished, can expect to get a trial in 'a regularly constituted court.'"
Would love to get more support for your statement, as I had never heard (and can't find supporting evidence) that the military can legally execute someone who had been detained, under any circumstance.