Section 61 forbids detention of an arrested person for more than twenty-four hours without a special order under section 167, and expressly excludes the time necessary for the journey to the court. The clock runs from the moment of arrest, not from registration of the first information report or the start of investigation. Custody beyond that period without a Magistrate's authorisation is illegal and entitles the arrested person to release.