Dead detainee 'was to be freed'