Article 171. Every person has the right to freedom and security. No one may be deprived of his or her freedom except in accordance with the provisions of this section and in the cases and in the manner provided for by the law.2. Preventive arrest may last no longer than the time strictly necessary in order to carry out the investigations aimed at establishing the events; in any case the person arrested must be set free or handed over to the judicial authorities within a maximum period of seventy-two hours. 3. Every person arrested must be informed immediately, and in a way understandable to him or her, of his or her rights and of the grounds for his or her arrest, and may not be compelled to make a statement. The arrested person shall be guaranteed the assistance of a lawyer during police and judicial proceedings, under the terms to be laid down by the law. 4. An habeas corpus procedure shall be provided for by law in order to ensure the immediate handing over to the judicial authorities of any person illegally arrested. Likewise, the maximum period of provisional imprisonment shall be determined by law.