287. Commission or prevention of offence or prevention of flight.

A person may be deprived of his liberty1 if he is lawfully2 arrested or detained for the purpose of bringing him before the competent legal authority3 on reasonable suspicion4 of having committed an offence5 or when it is reasonably considered necessary to prevent his committing an offence or fleeing after having done so6. Common to all three limbs of this exception are the preconditions that any arrest or detention of a person must be lawful