The man had been detained for more than 37 days without being charged with any immigration violation.