Habeas corpus is a fundamental legal instrument safeguarding individual freedom against arbitrary state action. It is a court order requiring law enforcement to bring a prisoner before the court to determine if the person's imprisonment or detention is lawful.