Habeas corpus is a writ (legal action) which requires a person under arrest to be brought before a judge or into court. This ensures that a prisoner can be released from unlawful detention, in other words, detention lacking sufficient cause or evidence. The remedy can be sought by the prisoner or by another person coming to the prisoner's aid. The legal right to apply for a habeas corpus is also called by the same name. This right originated in the English legal system, and is now available in many nations. It has historically been an important legal instrument safeguarding individual freedom against arbitrary state action.
Contributions by Andrew Yong, Flugkupeskce777777777, and 126.96.36.199.