A Kentucky Petition for Writ of Habeas Corpus Under 28 U.S.C. 2254 is a document filed in a federal court by an inmate in a Kentucky prison to challenge the legality of their confinement. The petition must be filed to challenge a conviction or sentence imposed by a state court in Kentucky, or to challenge any other form of detention imposed by a state authority. This type of petition may be filed by an individual that is currently in custody, or by one that has been released, but still wishes to challenge the legality of their confinement. There are two types of Kentucky Petition for Writ of Habeas Corpus Under 28 U.S.C. 2254: First, a person may file a petition for a writ of habeas corpus ad prosequendum, which is a request for an order from the court to bring a prisoner before the court to answer a criminal charge or to testify in a proceeding. Second, a person may file a petition for a writ of habeas corpus ad subjiciendum, which is a request for an order from the court for the release of a prisoner from unlawful custody.