A Petition for Writ of Habeas Corpus Under 28 U.S.C. Sec. 2254 is a legal document filed in a federal court by a person who is in custody and seeks to have their detention declared unlawful or to be released from custody. The petitioner must show that their detention is in violation of their constitutional rights or that the state proceedings in which they were convicted were unlawful. It is a form of civil action, and is governed by federal laws such as 28 U.S.C. Sec. 2254. There are three types of Petition for Writ of Habeas Corpus Under 28 U.S.C. Sec. 2254: a habeas corpus petition in the state court, a habeas corpus petition in the federal court, and a habeas corpus petition in the Supreme Court. Each type of petition is designed to challenge a conviction or sentence on the grounds that the petitioner's constitutional rights were violated. In the state court, the petitioner is challenging the conviction or sentence on the grounds that the state court proceedings in which they were convicted were unlawful. In the federal court, the petitioner is challenging the conviction or sentence on the grounds that the federal laws governing the proceedings in which they were convicted were violated. In the Supreme Court, the petitioner is challenging the conviction or sentence on the grounds that the Supreme Court's interpretation of the law was incorrect.