Habeas corpus is a legal writ (court order) that requires a person under arrest to be brought before a judge or into court. It's a fundamental protection against unlawful detention. Habeas corpus is specifically classified as a 'writ' in legal terminology, not merely an order, law, or rule.