The High Court ruling came at the conclusion of a lawsuit claim by Serdar Mohammed, an Afghan captured by British forces during a military operation in Helmand province in 2010.
The claimant, who was suspected of being a Taliban commander, alleged he was unlawfully detained by British soldiers for a total of 110 days.
Siding with him, High Court judge George Leggatt ruled Friday the British government had no basis for detaining him beyond 96 hours, either under Afghan or international law.